search for: putc

Displaying 20 results from an estimated 60 matches for "putc".

Did you mean: put
2006 Oct 31
0
6266832 UNIX98/UNIX03: getc(), getchar(), putc(), putchar() did not set stream to byte orientation
Author: muffin Repository: /hg/zfs-crypto/gate Revision: fecd74c42540dbb707f29987c4b4e10ecff69818 Log message: 6266832 UNIX98/UNIX03: getc(), getchar(), putc(), putchar() did not set stream to byte orientation Files: update: usr/src/head/iso/stdio_iso.h
2020 Apr 04
0
[PATCH nbdkit 2/2] tmpdisk: Pass any parameters as shell variables to the command.
...un_command (const char *disk) /* Avoid stdin/stdout leaking (because of nbdkit -s). */ fprintf (fp, "exec </dev/null >/dev/null\n"); - /* Set the shell variables. */ + /* Set the standard shell variables. */ fprintf (fp, "disk="); shell_quote (disk, fp); putc ('\n', fp); - if (label) { - fprintf (fp, "label="); - shell_quote (label, fp); - putc ('\n', fp); - } fprintf (fp, "size=%" PRIi64 "\n", size); - fprintf (fp, "type="); - shell_quote (type, fp); putc ('\n', fp); +...
2020 Jul 21
0
Re: [PATCH nbdkit] server: Deprecate the -e/--exportname parameter.
...; > if (fp == NULL) { > perror ("open_memstream"); > @@ -74,27 +72,13 @@ run_command (void) > if (port) { > fprintf (fp, "nbd://localhost:"); > shell_quote (port, fp); > - if (strcmp (exportname, "") != 0) { > - putc ('/', fp); > - uri_quote (exportname, fp); > - } > } > else if (unixsocket) { > - fprintf (fp, "nbd+unix://"); > - if (strcmp (exportname, "") != 0) { > - putc ('/', fp); > - uri_quote (exportname, fp); >...
2020 Apr 07
2
[PATCH nbdkit v2] tmpdisk: Generalize the tmpdisk plugin
An evolution of v1 here: https://www.redhat.com/archives/libguestfs/2020-April/msg00035.html I want to generalize the tmpdisk plugin, particularly so you can use commands like ‘qemu-img create’ or even ‘virt-builder’. (Actually virt-builder really works - I tested it - but of course it causes a 30+ second delay when connecting to the server.) You can now use commands such as: nbdkit tmpdisk
2012 Feb 04
3
the ^ and % operators in context
...twise. In this context, we take a file, and go through each character and encrypt it. But why are the ^ and % operators used here: def encrypt(reader, writer) key_index = 0 while not reader.eof? clear_char = reader.getc encrypted_char = clear_char ^ @key[key_index] writer.putc(encrypted_char) key_index = (key_index + 1) % @key.size end end thanks for response -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCG...
2012 Mar 11
1
[PATCH] Coalesce printable characters in debug and trace messages (RHBZ#802109).
...* Case 2: Messages from other sources: These messages should NOT * contain \n or \r. If they do, it is escaped. However we also * need to print a real end of line after these messages. + * + * RHBZ#802109: Because stderr is usually not buffered, avoid + * single 'putc' calls (which translate to a 1 byte write), and + * try to send longest possible strings in single fwrite calls + * (thanks to Jim Meyering for the basic approach). */ +#define NO_ESCAPING(c) \ + (c_isprint ((c)) || (from_appliance && ((c) == '\n' || (c) == ...
2020 Apr 07
0
[PATCH nbdkit v2] tmpdisk: Pass any parameters as shell variables to the command.
...un_command (const char *disk) /* Avoid stdin/stdout leaking (because of nbdkit -s). */ fprintf (fp, "exec </dev/null >/dev/null\n"); - /* Set the shell variables. */ + /* Set the standard shell variables. */ fprintf (fp, "disk="); shell_quote (disk, fp); putc ('\n', fp); - if (label) { - fprintf (fp, "label="); - shell_quote (label, fp); + fprintf (fp, "size=%" PRIi64 "\n", requested_size); + putc ('\n', fp); + + /* The other parameters/shell variables. */ + for (v = vars; v != NULL; v = v->nex...
2013 Sep 03
1
[PATCH v2] tftp-hpa: add error check for disk filled up
...2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/common/tftpsubs.c b/common/tftpsubs.c index 8c999f6..172776c 100644 --- a/common/tftpsubs.c +++ b/common/tftpsubs.c @@ -215,7 +215,9 @@ int write_behind(FILE * file, int convert) goto skipit; /* just skip over the putc */ /* else just fall through and allow it */ } - putc(c, file); + if (putc(c, file) == EOF) { + return -1; + } skipit: prevchar = c; } diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c index 1873e70..c2adbda 100644 --- a/tftpd/tftpd.c +++ b/tftpd/t...
2005 Mar 17
1
ocfs seek-performance
...ted) from kernel's POV. i did some benchmarking with Bonnie (http://www.textuality.com/bonnie/): # ./Bonnie -d /tmp/ocfstest/ -s 1024 -m bn1rac001 -o_direct -p 1 Bonnie 1.4: File '/tmp/ocfstest/Bonnie.7166', size: 1073741824, volumes: 1 Using O_DIRECT for block based I/O Writing with putc()... done: 10816 kB/s 59.1 %CPU Rewriting... done: 15607 kB/s 2.2 %CPU Writing intelligently... done: 18442 kB/s 2.1 %CPU Reading with getc()... done: 20908 kB/s 60.6 %CPU Reading intelligently... done: 45169 kB/s 4.4 %CPU Seeker 1...start...
2012 May 24
0
[PATCH RFC 2/9] console: prepare for non-COMn port support
...1] = { + [0 ... SERHND_IDX] = { + .rx_lock = SPIN_LOCK_UNLOCKED, + .tx_lock = SPIN_LOCK_UNLOCKED + } }; void serial_rx_interrupt(struct serial_port *port, struct cpu_user_regs *regs) @@ -81,6 +83,8 @@ void serial_tx_interrupt(struct serial_p port->driver->putc( port, port->txbuf[mask_serial_txbuf_idx(port->txbufc++)]); } + if ( i && port->driver->flush ) + port->driver->flush(port); } spin_unlock(&port->tx_lock); @@ -175,6 +179,9 @@ void serial_putc(int handle, char...
2020 Jul 21
3
[PATCH nbdkit] server: Deprecate the -e/--exportname parameter.
...- fp = open_memstream (&cmd, &len); if (fp == NULL) { perror ("open_memstream"); @@ -74,27 +72,13 @@ run_command (void) if (port) { fprintf (fp, "nbd://localhost:"); shell_quote (port, fp); - if (strcmp (exportname, "") != 0) { - putc ('/', fp); - uri_quote (exportname, fp); - } } else if (unixsocket) { - fprintf (fp, "nbd+unix://"); - if (strcmp (exportname, "") != 0) { - putc ('/', fp); - uri_quote (exportname, fp); - } - fprintf (fp, "\\?socket=&quot...
2013 Aug 22
2
[PATCH] tftp-hpa: add error check for disk filled up
...if (c == '\n') /* if have cr,lf then just */ - fseek(file, -1, 1); /* smash lf on top of the cr */ + count = count - 1; else if (c == '\0') /* if have cr,nul then */ goto skipit; /* just skip over the putc */ /* else just fall through and allow it */ } - putc(c, file); + buf[count] = c; + count ++; skipit: prevchar = c; } - return count; + return write(fileno(file), buf, count); } /* When an error has occurred, it is possible t...
2020 Apr 08
0
[PATCH nbdkit v3] tmpdisk: Pass any parameters as shell variables to the command.
...un_command (const char *disk) /* Avoid stdin/stdout leaking (because of nbdkit -s). */ fprintf (fp, "exec </dev/null >/dev/null\n"); - /* Set the shell variables. */ + /* Set the standard shell variables. */ fprintf (fp, "disk="); shell_quote (disk, fp); putc ('\n', fp); - if (label) { - fprintf (fp, "label="); - shell_quote (label, fp); + fprintf (fp, "size=%" PRIi64 "\n", requested_size); + putc ('\n', fp); + + /* The other parameters/shell variables. */ + for (v = vars; v != NULL; v = v->nex...
2020 Jul 22
2
[nbdkit PATCH] server: Reinstate limited use of -e/-exportname.
...fp = open_memstream (&cmd, &len); if (fp == NULL) { perror ("open_memstream"); @@ -72,15 +75,26 @@ run_command (void) if (port) { fprintf (fp, "nbd://localhost:"); shell_quote (port, fp); + if (strcmp (export_name, "") != 0) { + putc ('/', fp); + uri_quote (export_name, fp); + } } else if (unixsocket) { - fprintf (fp, "nbd+unix://\\?socket="); + fprintf (fp, "nbd+unix://"); + if (strcmp (export_name, "") != 0) { + putc ('/', fp); + uri_quote (export_...
2020 Mar 17
0
Re: [PATCH nbdkit v2] New tmpdisk plugin.
...== NULL) { > + nbdkit_error ("open_memstream: %m"); > + return -1; > + } > + > + /* Set the shell variables. */ > + fprintf (fp, "disk="); > + shell_quote (disk, fp); [1]...here you are correctly quoting the definition of disk, and...[2] > + putc ('\n', fp); > + if (label) { > + fprintf (fp, "label="); > + shell_quote (label, fp); > + putc ('\n', fp); > + } > + fprintf (fp, "size=%" PRIi64 "\n", size); > + fprintf (fp, "type="); > + shell_quote (ty...
2012 May 09
12
out of memory (java heap space) on zip creation (jruby)
I am using rubyzip and am trying to put a huge csv file with 1.4 million rows into the zip file. Using jruby I get a out of heap error. I believe the error happens in the block below: Zip::ZipOutputStream.open(zip_path) do |zos| zos.put_next_entry(File.basename(csv_path)) zos.print IO.read(csv_path) end -- You received this message because you are subscribed to the Google
2016 Mar 19
2
Need help with code generation
If you plan on calling C runtime library functions, you probably want to do what I did: Cheat, and make a libruntime.a (with C functions to do stuff your compiler can't do natively) and then link that using clang or gcc. https://github.com/Leporacanthicus/lacsap/blob/master/binary.cpp#L124 At some point, I plan to replace my runtime library with native Pascal code, at which point I will be
2020 Apr 08
2
[PATCH nbdkit v3] tmpdisk: Generalize the tmpdisk plugin.
v2 was here: https://www.redhat.com/archives/libguestfs/2020-April/msg00075.html In v3: - Add [VAR=VALUE ...] to manual. - Various minor improvements to the manual. - Work (at least, in theory - not tested) with block devices or symlinks. I didn't document this because it's hard to ensure these files or block devices would be cleaned up, so here be dragons. - Remove O_NOCTTY. -
2012 Jul 02
0
[klibc:master] [OUTPUT] Make outc an inline function
...d, 13 insertions(+), 2 deletions(-) diff --git a/usr/dash/output.h b/usr/dash/output.h index d123301..f853e9d 100644 --- a/usr/dash/output.h +++ b/usr/dash/output.h @@ -97,10 +97,21 @@ freestdout() #define OUTPUT_ERR 01 /* error occurred on output */ #ifdef USE_GLIBC_STDIO -#define outc(c, o) putc((c), (o)->stream) +static inline void outc(int ch, struct output *file) +{ + putc(ch, file->stream); +} #define doformat(d, f, a) vfprintf((d)->stream, (f), (a)) #else -#define outc(c, file) ((file)->nextc == (file)->end ? outcslow((c), (file)) : (*(file)->nextc = (c), (file)-&g...
2013 Sep 03
1
[PATCH] tftp-hpa: add error check for disk filled up
...by: Roy.Li <rongqing.li at windriver.com> > > Don't mix stdio and raw I/O this way. > > The right thing to do is either to use fflush() and ferror() to detect > an error condition, or consistently use raw I/O. I would prefer the former. > > -hpa > Could we check putc return value directly? -Roy > > > -- Best Reagrds, Roy | RongQing Li