| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
putwchar(), but this time avoid redundantly declaring __stdinp and
__stdoutp when source files include both <stdio.h> and <wchar.h>.
|
|
|
|
| |
benefit of obsolete C preprocessors.
|
|
|
|
|
|
|
| |
ferror(), fileno() and clearerr(), using the value of __isthreaded to
decide between the fast inline single-threaded code and the more
general function equivalent. This gives most of the performance
benefits of the old unsafe macros while preserving thread safety.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
an int constant to a long constant. This change improves consistency
in the following two ways:
1. The first 8 arguments are always passed in registers on ia64, which
by virtue of the generated code implicitly widens ints to longs and
allows the use of an 32-bit integral type for 64-bit arguments.
Subsequent arguments are passed onto the memory stack, which does
not exhibit the same behaviour and consequently do not allow this.
In practice this means that variadic functions taking pointers
and given NULL (without cast) work as long as the NULL is passed
in one of the first 8 arguments. A SIGSEGV is more likely the
result if such would be done for stack-based arguments. This is
due to the fact that the upper 4 bytes remain undefined.
2. All 64-bit platforms that FreeBSD supports, with the obvious
exception of ia64, allow 32-bit integral types (specifically NULL)
when 64-bit pointers are expected in variadic functions by way of
how the compiler generates code. As such, code that works correctly
(whether rightfully so or not) on any platform other than ia64, may
fail on ia64.
To more easily allow tweaking of the definition of NULL, this commit
removes the 12 definitions in the various headers and puts it in a
new header that can be included whenever NULL is to be made visible.
This commit fixes GNOME, emacs, xemacs and a whole bunch of ports
that I don't particularly care about at this time...
|
| |
|
|
|
|
| |
for __vfscanf.
|
| |
|
|
|
|
|
| |
5.0-R territory, as threatened. This only affects antique 5.0
systems that have not had a 'make world' done for well over a year.
|
|
|
|
|
|
|
|
|
|
| |
o Add typedef for va_list.
o Add comment about missing restrict type-qualifiers.
o Move vscanf(), vsscanf() and vfscanf() to the C99-visible block.
o Add note about missing backing function for vfscanf().
o Restrict L_cuserid to only older versions of POSIX, and BSD
namespaces.
o Conditionalize some BSD-specific foo_unlock() macros.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
macros, which are only MD because of gratuitous differences between
architectures.
o Change all headers to make use of this. This mainly involves
changing:
#ifdef _BSD_FOO_T_
typedef _BSD_FOO_T_ foo_t;
#undef _BSD_FOO_T_
#endif
to:
#ifndef _FOO_T_DECLARED
typedef __foo_t foo_t;
#define _FOO_T_DECLARED
#endif
Concept by: bde
Reviewed by: jake, obrien
|
|
|
|
|
|
| |
qualifier to function prototypes and definitions where
appropriate using the '__restrict' macro.
- Update the manual page.
|
|
|
|
|
| |
definitions to comply with IEEE Std 1003.1-2001.
- Update the manual pages.
|
|
|
|
|
|
|
|
| |
public prototypes of setbuf(3) and setvbuf(3) using the
'__restrict' macro from <sys/cdefs.h> to be compliant with
IEEE Std 1003.1-2001.
- Replace the K&R with ANSI-C function definitions.
- Bring the manual page up-to-date.
|
|
|
|
|
|
|
|
| |
file. Correct visibility conditions and order blocks of declarations
in order of increasing inclusiveness. Note that [v]snprintf() is now
in ISO C and f{seek,tell}o() are now in POSIX. Deprecated getw() and
putw() are no longer visible in XSH6 namespace (and should probably
be removed from BSD namespace as well).
|
|
|
|
|
|
| |
# This appears to not break X11, but I'm having problems compiling the
# glide part of the server with or without this patch, so I can't tell
# for sure.
|
| |
|
|
|
|
| |
Submitted by: bde
|
|
|
|
| |
I leave it up to someone else to fix this breakage properly.
|
|
|
|
|
|
|
|
| |
switch over to using a future-proof stdin/out/err.
Note that if you run 4.x binaries on your system, you will certainly
want to update /usr/lib/compat/libc.so.4. The easiest way is to
add "COMPAT4X= yes" in your /etc/make.conf.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was foiled because of dynamic copy relocations that caused compile-time
space to be reserved in .bss and at run time a blob of data was copied to
that space and everything used the .bss version.. The problem is that
the space is reserved at compile time, not runtime... So we *still* could
not change the size of FILE. Sigh. :-(
Replace it with something that does actually work and really does let us
make 'FILE' extendable. It also happens to be the same as Linux does in
glibc, but has the slight cost of a pointer. Note that this is the
same cost that 'fp = fopen(), fprintf(fp, ...); fclose(fp);' has.
Fortunately, actual references to stdin/out/err are not all that common
since we have implicit stdin/out/err-using versions of functions
(printf() vs. fprintf()).
|
|
|
|
|
|
|
| |
* get rid of space (0x20) before tab (^I)
* indent with ^I, not 0x20
* continuation line for prototypes is for 0x20's past function's name col.
* etc.
|
|
|
|
|
|
| |
why I changed it to const.
Noticed by: David Wolfskill <david@catwhisker.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
arguments where the format string is obtained from user data, or
otherwise difficult to verify statically.
Example usage:
printf(fmtcheck(user_format, standard_format), arg1, arg2);
checks the format string user_format for consistency (same number/order/
type of format operators) with standard_format. If they differ,
standard_format is used instead to avoid potential crashes or security
violations.
Obtained from: NetBSD
Reviewed by: -arch
|
|
|
|
|
|
|
| |
lock definitions to it. flockfile state is now allocated
along with the rest of FILE. This eliminates the need for a
separate allocation of flockfile state as well as eliminating
the mutex/lock used to serialize its allocation.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
o Back out the __std* stuff. Can't figure out how to do this right now,
so we'll save it for late.
o use _up as a pointer for extra fields that we need to access.
o back out the libc major version bump.
Submitted by: green
reviewed by: peter, imp, green, obrien (to varying degrees).
We'll fix the "how do we stop encoding sizeof(FILE) in binaries" part
later.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bikeshed in -arch. It isn't quite over, but it has been well established
that this can be adjusted or refined. But we do seem to have consensis
on a major bump of some sort. After this, it should reasonably safe
to build world again.
This change is to get rid of __sF[] and use seperate __stdin/out/err
handles. This means we can pad on extra bits onto the end of FILE
at will without going through this all over again. __sF[] was evil
because it compiled the sizeof(FILE) into every stdio using program.
Asbestos suit on: check!
Peril sensitive sunglasses on: check!
*gulp!*
|
|
|
|
|
| |
FILE *buffer = stdout;
so back it out for now.
|
|
|
|
|
|
|
|
|
|
| |
try a hopefully more robust stdin/stdout/stderr. This costs an indirect
pointer fetch, but saves us from changes in 'FILE'. The __stdin stuff
is there to not pollute application name space if the application does
not use <stdio.h> and also in case something depended on the current
behavior where stdin etc was a #define.
Reviewed by: eischen, dillon
|
|
|
|
| |
Add a lock to FILE and define an additional flag.
|
|
|
|
|
|
|
| |
Clean up stdio.h a bit and remove _THREAD_SAFE. Some of the
usual macros getc, putc, getchar, putchar are no longer macros.
Approved by: -arch
|
| |
|
| |
|
|
|
|
|
|
|
| |
Fixed fgetpos() and fsetpos() for offsets > 2GB.
PR: 8637
Submitted by: Dan Nelson <dnelson@emsphone.com> (adjusted by me a little)
|
| |
|
|
|
|
|
|
|
|
| |
Use them to `make gcc -Wformat' check formats for all printf-like
and scanf-like functions in /usr/src except for the err()/warn()
family. err() isn't quite printf-like since its format arg can
legitimately be NULL. syslog() isn't quite printf-like, but gcc
already accepts %m, even for plain printf() when it shouldn't.
|
|
|
|
|
|
| |
asprintf() implementation.
Obtained from: Todd Miller <Todd.Miller@courtesan.com> via OpenBSD
|
|
|
|
|
|
|
|
|
|
| |
as threatened in the 4-5 year old comment. Most of the change is
in <machine/ansi.h>; this commit just removes cruft for the strict
ANSI case. 64-bit types couldn't actually be defined using
__attribute__(()) in gcc-2.4, since attribute names in the
implementation namespace only became available in gcc-2.7. I've
probably just broken gcc-2.6 support by using the gcc-2.7 names
unconditionally.
|
|
|
|
|
|
| |
namespace and revision levels of ANSI and POSIX. This change only
removes the leading underscrore from the FILE locking functions
that POSIX defines.
|
|
|
|
|
|
|
|
| |
about spaces and tabs.
The externs in the static inline functions remain 'cause (a) they're
required; and (b) I can't find any gcc -W* cases where they generate
warnings.
|
|
|
|
|
|
|
|
| |
test for __isthreaded before calling the lock/unlock functions to
try to save some performance. The _THREAD_SAFE case should become the
default, but since it tests for a global variable in libc, people won't
be able to build -current on pre-3.0 systems unless the default leaves
it out. Such is life.
|
|
|
|
| |
Submitted by: bde
|
|
|
|
|
|
|
| |
Use _BSD_OFF_T_ instead of off_t so that we're still self-sufficent.
Copied the ftruncate/lseek()/mmap()/truncate() redeclaration hacks
from <sys/types.h> so that things depending on them don't break.
|
|
|
|
| |
(Just version number)
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.
|
| |
|
| |
|