summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* Add missing #if's for NO_FLOATING_POINTphk2006-04-015-4/+16
|
* Add __collate_load_error and __collate_range_cmp to the list ofdeischen2006-03-301-0/+1
| | | | | | | | | | | | | FBSDprivate locale symbols. These functions are needed by libcompat. Add _cleanup to the list of stdio FBSDprivate symbols. Some third party applications use this. This will be removed and replaced by fcloseall() once libc version is bumped. Add _res to the list of resolv symbols. Found by: portbuilder runs (thanks Kris!)
* Add each directory's symbol map file to SYM_MAPS.deischen2006-03-131-0/+2
|
* Add symbol maps and initial symbol version definitions to libc.deischen2006-03-131-0/+144
| | | | Reviewed by: davidxu
* Fix the %Q printf extension to behave as expectedphk2006-03-021-19/+9
|
* Remove spurious "union arg" from printf.hphk2006-02-041-2/+3
| | | | Make sure to always print something in the alternate time format.
* Add missing 's' suffix on alternate rendition of time.phk2006-01-311-1/+1
|
* Make the %V{is} extension handle a NULL pointer like %s does: output "(null)"phk2006-01-255-1/+187
| | | | | | | | | | | | | Add %M{essage} extension which prints an errno value as the corresponding string if possible or numerically otherwise. It is not currently possible to do the syslog(3) like %m extension because errno would need to get capatured on entry to the first function in the printf family, so %M requires you to supply errno as an argument. Add %Q{uote} extension which will print a string in double quotes with appropriate back-slash escapes (only) if necessary.
* Explicitely use a "signed char" instead of a "char", for those archs wherecognet2005-12-221-2/+2
| | | | char defaults to unsigned.
* Add an extensible version of our *printf(3) implementation to libcphk2005-12-169-0/+2054
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on probationary terms: it may go away again if it transpires it is a bad idea. This extensible printf version will only be used if either environment variable USE_XPRINTF is defined or one of the extension functions are called. or the global variable __use_xprintf is set greater than zero. In all other cases our traditional printf implementation will be used. The extensible version is slower than the default printf, mostly because less opportunity for combining I/O operation exists when faced with extensions. The default printf on the other hand is a bad case of spaghetti code. The extension API has a GLIBC compatible part and a FreeBSD version of same. The FreeBSD version exists because the GLIBC version may run afoul of our FILE * locking in multithreaded programs and it even further eliminate the opportunities for combining I/O operations. Include three demo extensions which can be enabled if desired: time (%T), hexdump (%H) and strvis (%V). %T can format time_t (%T), struct timeval (%lT) and struct timespec (%llT) in one of two human readable duration formats: "%.3llT" -> "20349.245" "%#.3llT" -> "5h39m9.245" %H will hexdump a sequence of bytes and takes a pointer and a length argument. The width specifies number of bytes per line. "%4H" -> "65 72 20 65" "%+4H" -> "0000 65 72 20 65" "%#4H" -> "65 72 20 65 |er e|" "%+#4H" -> "0000 65 72 20 65 |er e|" %V will dump a string in strvis format. "%V" -> "Hello\tWor\377ld" (C-style) "%0V" -> "Hello\011Wor\377ld" (octal) "%+V" -> "Hello%09Wor%FFld" (http-style) Tests, comments, bugreports etc are most welcome.
* With current pthread implementations, a mutex initialization willdavidxu2005-12-163-9/+19
| | | | | | | | | | | | allocate a memory block. sscanf calls __svfscanf which in turn calls fread, fread triggers mutex initialization but the mutex is not destroyed in sscanf, this leads to memory leak. To avoid the memory leak and performance issue, we create a none MT-safe version of fread: __fread, and instead let __svfscanf call __fread. PR: threads/90392 Patch submitted by: dhartmei MFC after: 7 days
* /* You're not supposed to hit this problem */phk2005-12-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some denormalized long double values, a bug in __hldtoa() (called from *printf()'s %A format) results in a base 16 digit being rounded up from 0xf to 0x10. When this digit is subsequently converted to string format, an index of 10 reaches past the end of the uppper-case hex/char array, picking up whatever the code segment happen to contain at that address. This mostly seem to be some character from the upper half of the byte range. When using the %a format instead of %A, the first character past the end of the lowercase hex/char table happens to be index 0 in the uppercase hex/char table hextable and therefore the string representation features a '0', which is supposedly correct. This leads me to belive that the proper fix _may_ be as simple as masking all but the lower four bits off after incrementing a hex-digit in libc/gdtoa/_hdtoa.c:roundup(). I worry however that the upper bit in 0x10 indicates a carry not carried. Until das@ or bde@ finds time to visit this issue, extend the hexdigit arrays with a 17th index containing '?' so that we get a invalid but consistent and printable output in both %a and %A formats whenever this bug strikes. This unmasks the bug in the %a format therefore solving the real issue may both become easier and more urgent. Possibly related to: PR 85080 With help by: bde@
* Fix prototype.ru2005-11-232-2/+2
|
* Use the correct function name as .Nm argument.brueffer2005-09-181-1/+1
| | | | | | PR: 86169 Submitted by: Toby Peterson <toby@apple.com> MFC after: 3 days
* Move the declaration of __cleanup to libc_private.h as it is used in bothstefanf2005-09-122-2/+3
| | | | stdio/ and stdlib/. Don't define __cleanup twice.
* Remove references to nonexistent "FreeBSD Security Architecture" document.tjr2005-09-053-15/+0
|
* Include <sys/types.h> and <limits.h> ourselves, don't assume they are includedstefanf2005-08-202-0/+2
| | | | | | | | | | through <pthread.h>. gen/sem.c: Prerequisite for <_semaphore.h> net/getprotoent.c: USHRT_MAX net/getservent.c: USHRT_MAX stdio/ungetwc.c: MB_LEN_MAX stdio/vfwscanf.c: MB_LEN_MAX
* Speed up __wcsconv() (and hence the printf() %ls format):tjr2005-07-241-34/+30
| | | | | - use wcsrtombs() instead of a wcrtomb() loop where possible. - avoid wcrtomb() loop when output precision is small.
* The header glue.h should provide just a declaration for the variablestefanf2005-05-131-1/+2
| | | | | | | | __sglue, not a definition. PR: 80378 Submitted by: John Engelhart <johne@zang.com> MFC after: 1 week
* The correct description for mode "w" isdes2005-05-041-1/+1
| | | | | | | | (((truncate to zero length) or (create)) (text file)) (for writing) and not ((truncate file to zero length) or (create text file)) (for writing) MFC after: 1 week
* Be bug-for-bug compatible with the C standard with respect todas2005-04-162-4/+16
| | | | printf("%#.0o", 0). Cite an amusing passage from a defect report.
* Remove unused variable.stefanf2005-04-081-3/+2
|
* Fix EOVERFLOW detection in vswprintf(3)fjoe2005-02-211-4/+5
| | | | | Reviewed by: tjr MFC after: 2 weeks
* Sort sections.ru2005-01-203-55/+55
|
* Scheduled mdoc(7) sweep.ru2005-01-111-1/+3
|
* Document that the length modifier l is ignored for floating pointstefanf2004-10-161-1/+3
| | | | conversion specifiers (a, A, e, E, f, F, g and G).
* Don't add integers to void pointers.stefanf2004-10-031-1/+2
|
* Don't forget to va_end() the va_list we get from va_copy().des2004-08-262-0/+2
| | | | | Submitted by: Sean McNeil <sean@mcneil.com> MFC after: 3 days
* note that it is the caller's responsibility to free any buffer passedalfred2004-08-241-0/+5
| | | | to setvbuf(3) and friends.
* Fix an off-by-one bug that caused the first character of the buffer totjr2004-08-061-2/+1
| | | | be uninitialized.
* Read directly from the stdio buffer using the new __mbsnrtowcs() interfacetjr2004-07-211-14/+38
| | | | instead of making repeated calls to __fgetwc().
* Implement the GNU extensions of mbsnrtowcs() and wcsnrtombs(). These aretjr2004-07-211-1/+2
| | | | | | | convenient when the source string isn't null-terminated. Implement the other conversion functions (mbstowcs(), mbsrtowcs(), wcstombs(), wcsrtombs()) in terms of these new functions.
* Use __wcsrtombs() and __sfvwrite() to convert and write the wide charactertjr2004-07-211-8/+25
| | | | string instead of multiple calls to __fputwc().
* Call __mbrtowc() and __wcrtomb() directly instead of taking detourstjr2004-07-203-3/+6
| | | | through mbrtowc() and wcrtomb().
* Add a cross reference to fgetwln(3).tjr2004-07-161-0/+1
|
* Add fgetwln(), a wide character version of fgetln().tjr2004-07-163-2/+192
|
* Rename slbexpand() to __slbexpand() and make it available outsidetjr2004-07-162-4/+5
| | | | of fgetln.c (non-static).
* Slightly reorganize and simplify.tjr2004-07-091-24/+11
|
* Add commentary explaining why we return EBADF upon attempts to fflush() acperciva2004-07-041-0/+12
| | | | | | read-only file. Discussed on: -current
* Eliminate double whitespace.ru2004-07-031-2/+2
|
* Mechanically kill hard sentence breaks.ru2004-07-021-4/+8
|
* Markup, grammar, and spelling fixes.ru2004-06-301-4/+3
|
* Spelling fixes.mpp2004-06-211-1/+1
|
* The third operand of the conditional operator should have type void too.stefanf2004-06-082-2/+2
| | | | Approved by: das (mentor)
* Rename cantwrite() to prepwrite(). The latter is less confusing,das2004-06-081-4/+1
| | | | | | since the macro isn't really a predicate, and it has side-effects. Also, don't set errno if prepwrite() fails, since this is done in prepwrite() now.
* Rename cantwrite() to prepwrite(). The latter is less confusing,das2004-06-084-5/+6
| | | | since the macro isn't really a predicate, and it has side-effects.
* Set errno to EBADF on attempts to write to a stream that is notdas2004-06-081-2/+5
| | | | | | | | | writable. Affected callers include fwrite(), put?(), and *printf(). The issue of whether this is the right errno for funopened streams is unresolved, but that's an obscure case, and some errno is better than no errno. Discussed with: bde, jkh
* Provide trivial macro implementations of getwc(), getwchar(), putwc() andtjr2004-05-254-0/+8
| | | | putwchar() to reduce function call overhead.
* Perform conversions straight from the stream buffer instead of scanningtjr2004-05-221-18/+19
| | | | | | | through byte by byte with mbrtowc(). In the usual case (buffer is big enough to contain the multibyte character, character does not straddle buffer boundary) this results in only one call to mbrtowc() for each wide character read.
* Associate a multibyte conversion state object with each stream. Reset ittjr2004-05-227-42/+24
| | | | | | | | | to the initial state when a stream is opened or seeked upon. Use the stream's conversion state object instead of a freshly-zeroed one in fgetwc(), fputwc() and ungetwc(). This is only a performance improvement for now, but it would also be required in order to support state-dependent encodings.
OpenPOWER on IntegriCloud