summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* o Add ENVIRONMENT section and mention there that TMPDIR is ignoredmaxim2007-03-161-1/+14
| | | | | | | | when issetugid(3) is true. PR: docs/108346 Obtained from: OpenBSD MFC after: 1 week
* Remove 3rd clause, renumber, ok per emailimp2007-01-121-4/+1
|
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-09100-400/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* Fix rounding of 0xf for hex fp formats.das2007-01-031-2/+2
| | | | PR: 90333
* Revert the rev. 1.4, it causes breakage on most arches except i386.kib2006-10-231-4/+1
| | | | | | | | | Remove the const qualifier from ap argument for __v2printf, that induced that breakage, and seems to be the real reason for bad code. ap is modified inside the __v2printf body by va_arg macro. Pointy hat to: kib Approved by: pjd (mentor)
* Workaround for (what seems to be) compiler error for gcc 3.4.6. Onkib2006-10-211-1/+4
| | | | | | | | | | | | | i386 with default optimization level (-O2), va_list pointer ap in the __v2printf function is advanced before the use. That cause argument shift and garbage instead last argument in printf-family when xprintf is activated. The nsswitch is easy victim of the bug. Reviewed by: kan Approved by: kan (mentor) MFC after: 1 week
* file == NULL:ache2006-10-161-9/+14
| | | | | | | | | | | | | Issue __sflush() before possible setting O_APPEND mode or ftruncate(), write to wrong place may occurse oserwise. Use simplified _sseek() to the start, if no O_APPEND is set, instead of _fseeko() (_sseek() to the end, if O_APPEND, occurse later, as for file != NULL). Don't check seek error return, as original fopen() and freopen() never does. file != NULL: Add missing _sseek() to the end.
* Honor errno obtained from __sflagsache2006-10-161-1/+3
| | | | Move errno restoring after FUNLOCKFILE in one case
* Back out ftruncate error handling. There can some file tipesache2006-10-161-9/+2
| | | | f.e. sockets when ftruncate normally fail.
* Do real seekache2006-10-151-3/+11
| | | | | | | Catch ftruncate errors PR: 104295 Submitted by: ru (seek)
* Use correct type in va_arg argument.kan2006-09-212-2/+2
|
* Markup fixes.ru2006-09-171-1/+1
|
* Remove alpha left-overs.ru2006-08-221-1/+1
|
* Oops, correct the weak reference (s/fclose/fcloseall).deischen2006-04-221-1/+1
| | | | Spotted by: Antoine Brodin (antoine _dot_ brodin _at_ laposte _dot_ net)
* Now that libc has fcloseall(), remove _cleanup() from the listdeischen2006-04-221-1/+0
| | | | of FreeBSD private symbols.
* Add fcloseall() to libc. This removes the need to export _cleanup().deischen2006-04-225-4/+60
| | | | | | Linux also provides an fcloseall() implementation. Discussed on: arch
* 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().
OpenPOWER on IntegriCloud