mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
Fri Jun 7 09:11:17 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* mach/mach_syscalls.c: Obsolete file removed. * mach/mach_syscalls.h: Likewise. * mach/mach_traps.S: Likewise. * mach/msg_destroy.c: Likewise. * mach/vm_page_size.c: Likewise.
This commit is contained in:
parent
bd5fa7727c
commit
9f447fb32c
@ -38,6 +38,9 @@ else
|
|||||||
sysdep_dirs := $(addprefix $(..),$(sysdep_dirs))
|
sysdep_dirs := $(addprefix $(..),$(sysdep_dirs))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Make sure both stdio and libio get in, whichever is in use.
|
||||||
|
subdirs += stdio libio
|
||||||
|
|
||||||
sysdep-Subdir-files := $(wildcard $(addsuffix /Subdirs,$(sysdep_dirs)))
|
sysdep-Subdir-files := $(wildcard $(addsuffix /Subdirs,$(sysdep_dirs)))
|
||||||
ifdef sysdep-Subdir-files
|
ifdef sysdep-Subdir-files
|
||||||
subdirs := $(sort $(subdirs) \
|
subdirs := $(sort $(subdirs) \
|
||||||
@ -165,7 +168,7 @@ foo:=$(shell echo '+sysdep-dist=$(+sysdep-dist)' >&2)
|
|||||||
|
|
||||||
subdirs := $(filter-out crypt,$(subdirs))
|
subdirs := $(filter-out crypt,$(subdirs))
|
||||||
|
|
||||||
+sysdep-tsrcs := $(wildcard $(foreach file,Makefile Implies \
|
+sysdep-tsrcs := $(wildcard $(foreach file,Makefile Implies syscalls.list\
|
||||||
configure configure.in,\
|
configure configure.in,\
|
||||||
$(addsuffix /$(file),$(sysdep_dirs)))) \
|
$(addsuffix /$(file),$(sysdep_dirs)))) \
|
||||||
$(+sysdep-dist)
|
$(+sysdep-dist)
|
||||||
|
7
Makefile
7
Makefile
@ -223,13 +223,14 @@ parent_echo-distinfo:
|
|||||||
# Make the distribution tarfile.
|
# Make the distribution tarfile.
|
||||||
|
|
||||||
distribute := README INSTALL FAQ NOTES NEWS PROJECTS \
|
distribute := README INSTALL FAQ NOTES NEWS PROJECTS \
|
||||||
COPYING.LIB COPYING ChangeLog ChangeLog.[0-9] \
|
COPYING.LIB COPYING ChangeLog ChangeLog.[0-9] \
|
||||||
Makefile Makeconfig Makerules Rules Make-dist MakeTAGS \
|
Makefile Makeconfig Makerules Rules Make-dist MakeTAGS \
|
||||||
extra-lib.mk o-iterator.mk \
|
extra-lib.mk o-iterator.mk \
|
||||||
ansidecl.h mkinstalldirs move-if-change install-sh \
|
ansidecl.h mkinstalldirs move-if-change install-sh \
|
||||||
configure configure.in aclocal.m4 config.sub config.guess\
|
configure configure.in aclocal.m4 config.sub config.guess\
|
||||||
config.make.in config-name.in Makefile.in \
|
config.h.in config.make.in config-name.in Makefile.in \
|
||||||
munch-tmpl.c munch.awk sysdep.h set-hooks.h libc-symbols.h
|
munch-tmpl.c munch.awk \
|
||||||
|
sysdep.h set-hooks.h libc-symbols.h version.h shlib-versions
|
||||||
|
|
||||||
distribute := $(strip $(distribute))
|
distribute := $(strip $(distribute))
|
||||||
generated := $(generated) stubs.h
|
generated := $(generated) stubs.h
|
||||||
|
@ -35,7 +35,7 @@ omit-deps = $(patsubst %.o,%,$(start-installed-name) g$(start-installed-name) \
|
|||||||
$(csu-dummies))
|
$(csu-dummies))
|
||||||
install-lib = $(start-installed-name) g$(start-installed-name) \
|
install-lib = $(start-installed-name) g$(start-installed-name) \
|
||||||
$(csu-dummies)
|
$(csu-dummies)
|
||||||
distribute = initfini.c
|
distribute = initfini.c gmon-start.c start.c
|
||||||
|
|
||||||
all: # Make this the default target; it will be defined in Rules.
|
all: # Make this the default target; it will be defined in Rules.
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ libdl-inhibit-o = $(filter-out .so,$(object-suffixes)) # Build only shared.
|
|||||||
|
|
||||||
rtld-routines := rtld $(addprefix dl-,minimal load lookup object reloc \
|
rtld-routines := rtld $(addprefix dl-,minimal load lookup object reloc \
|
||||||
deps runtime sysdep error init fini)
|
deps runtime sysdep error init fini)
|
||||||
distribute = $(rtld-routines:=.c) dynamic-link.h do-rel.h \
|
distribute = $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
|
||||||
soinit.c sofini.c ldd.sh.in linux-compat.c
|
soinit.c sofini.c ldd.sh.in linux-compat.c
|
||||||
|
|
||||||
all: # Make this the default target; it will be defined in Rules.
|
all: # Make this the default target; it will be defined in Rules.
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
subdir := gmon
|
subdir := gmon
|
||||||
|
|
||||||
headers := sys/gmon.h sys/gmon_out.h
|
headers := sys/gmon.h sys/gmon_out.h
|
||||||
distribute := machine-gmon.h
|
distribute := machine-gmon.h profil-counter.h
|
||||||
routines := gmon mcount profil bb_init_func bb_exit_func
|
routines := gmon mcount profil bb_init_func bb_exit_func
|
||||||
|
|
||||||
include ../Rules
|
include ../Rules
|
||||||
|
@ -25,7 +25,7 @@ include ../Makeconfig
|
|||||||
|
|
||||||
|
|
||||||
headers = hurd.h $(interface-headers) \
|
headers = hurd.h $(interface-headers) \
|
||||||
$(addprefix hurd/,fd.h id.h port.h signal.h sigpreempt.h \
|
$(addprefix hurd/,fd.h id.h port.h signal.h sigpreempt.h ioctl.h\
|
||||||
userlink.h resource.h threadvar.h lookup.h)
|
userlink.h resource.h threadvar.h lookup.h)
|
||||||
|
|
||||||
distribute := hurdstartup.h hurdfault.h intr-rpc.defs STATUS
|
distribute := hurdstartup.h hurdfault.h intr-rpc.defs STATUS
|
||||||
@ -59,6 +59,7 @@ sig = hurdsig hurdfault siginfo hurd-raise preempt-sig \
|
|||||||
dtable = dtable port2fd new-fd alloc-fd intern-fd \
|
dtable = dtable port2fd new-fd alloc-fd intern-fd \
|
||||||
getdport openport \
|
getdport openport \
|
||||||
fd-close fd-read fd-write hurdioctl ctty-input ctty-output
|
fd-close fd-read fd-write hurdioctl ctty-input ctty-output
|
||||||
|
distribute = intr-rpc.defs intr-rpc.h faultexc.defs
|
||||||
|
|
||||||
# XXX this is a temporary hack; see hurdmalloc.h
|
# XXX this is a temporary hack; see hurdmalloc.h
|
||||||
routines += hurdmalloc
|
routines += hurdmalloc
|
||||||
|
@ -27,7 +27,7 @@ distribute = localeinfo.h categories.def \
|
|||||||
$(lib-modules:=.c) config.h simple-hash.h iso-4217.def \
|
$(lib-modules:=.c) config.h simple-hash.h iso-4217.def \
|
||||||
charmap-kw.gperf charmap-kw.h locfile-token.h \
|
charmap-kw.gperf charmap-kw.h locfile-token.h \
|
||||||
locfile-kw.gperf locfile-kw.h linereader.h \
|
locfile-kw.gperf locfile-kw.h linereader.h \
|
||||||
locales.h locfile.h stringtrans.h
|
locales.h locfile.h stringtrans.h weight.h charset.h
|
||||||
routines = setlocale findlocale loadlocale localeconv nl_langinfo \
|
routines = setlocale findlocale loadlocale localeconv nl_langinfo \
|
||||||
mb_cur_max
|
mb_cur_max
|
||||||
categories = ctype messages monetary numeric time collate
|
categories = ctype messages monetary numeric time collate
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
/* Aliases for basic Mach system calls:
|
|
||||||
mach_task_self -> __mach_task_self, etc. */
|
|
||||||
|
|
||||||
#include <gnu-stabs.h>
|
|
||||||
|
|
||||||
#define SYSCALL(name, number, type, args, typed_args) \
|
|
||||||
function_alias (name, __##name, type, args, \
|
|
||||||
name typed_args)
|
|
||||||
|
|
||||||
#include "mach_syscalls.h"
|
|
@ -1,15 +0,0 @@
|
|||||||
/* Traps for Mach basic system calls and kernel RPC shortcuts. */
|
|
||||||
|
|
||||||
#include <sysdep.h>
|
|
||||||
|
|
||||||
#define SYSCALL(name, number, type, args, typed_args) \
|
|
||||||
SYSCALL_TRAP (__##name, number)
|
|
||||||
|
|
||||||
/* Basic syscalls. */
|
|
||||||
#include "mach_syscalls.h"
|
|
||||||
|
|
||||||
/* RPC shortcuts. */
|
|
||||||
#define SHORTCUT(name, number, args, typed_args) \
|
|
||||||
SYSCALL_TRAP (__syscall_##name, number)
|
|
||||||
|
|
||||||
#include "mach_shortcuts.h"
|
|
@ -1,4 +0,0 @@
|
|||||||
#include <gnu-stabs.h>
|
|
||||||
|
|
||||||
#undef mach_msg_destroy
|
|
||||||
symbol_alias (__mach_msg_destroy, mach_msg_destroy);
|
|
@ -1,3 +0,0 @@
|
|||||||
#include <gnu-stabs.h>
|
|
||||||
|
|
||||||
symbol_alias (__vm_page_size, vm_page_size);
|
|
@ -1,113 +0,0 @@
|
|||||||
@node Consistency Checking, Mathematics, Low-Level Terminal Interface, Top
|
|
||||||
@chapter Explicitly Checking Internal Consistency
|
|
||||||
@cindex consistency checking
|
|
||||||
@cindex impossible events
|
|
||||||
@cindex assertions
|
|
||||||
|
|
||||||
When you're writing a program, it's often a good idea to put in checks
|
|
||||||
at strategic places for ``impossible'' errors or violations of basic
|
|
||||||
assumptions. These kinds of checks are helpful in debugging problems
|
|
||||||
with the interfaces between different parts of the program, for example.
|
|
||||||
|
|
||||||
@pindex assert.h
|
|
||||||
The @code{assert} macro, defined in the header file @file{assert.h},
|
|
||||||
provides a convenient way to abort the program while printing some
|
|
||||||
debugging information about where in the program the error was detected.
|
|
||||||
|
|
||||||
@vindex NDEBUG
|
|
||||||
Once you think your program is debugged, you can disable the error
|
|
||||||
checks performed by the @code{assert} macro by recompiling with the
|
|
||||||
macro @code{NDEBUG} defined. This means you don't actually have to
|
|
||||||
change the program source code to disable these checks.
|
|
||||||
|
|
||||||
But disabling these consistency checks is undesirable unless they make
|
|
||||||
the program significantly slower. All else being equal, more error
|
|
||||||
checking is good no matter who is running the program. A wise user
|
|
||||||
would rather have a program crash, visibly, than have it return nonsense
|
|
||||||
without indicating anything might be wrong.
|
|
||||||
|
|
||||||
@comment assert.h
|
|
||||||
@comment ANSI
|
|
||||||
@deftypefn Macro void assert (int @var{expression})
|
|
||||||
Verify the programmer's belief that @var{expression} should be nonzero
|
|
||||||
at a certain point in the program.
|
|
||||||
|
|
||||||
If @code{NDEBUG} is not defined, @code{assert} tests the value of
|
|
||||||
@var{expression}. If it is false (zero), @code{assert} aborts the
|
|
||||||
program (@pxref{Aborting a Program}) after printing a message of the
|
|
||||||
form:
|
|
||||||
|
|
||||||
@smallexample
|
|
||||||
@file{@var{file}}:@var{linenum}: @var{function}: Assertion `@var{expression}' failed.
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
@noindent
|
|
||||||
on the standard error stream @code{stderr} (@pxref{Standard Streams}).
|
|
||||||
The filename and line number are taken from the C preprocessor macros
|
|
||||||
@code{__FILE__} and @code{__LINE__} and specify where the call to
|
|
||||||
@code{assert} was written. When using the GNU C compiler, the name of
|
|
||||||
the function which calls @code{assert} is taken from the built-in
|
|
||||||
variable @code{__PRETTY_FUNCTION__}; with older compilers, the function
|
|
||||||
name and following colon are omitted.
|
|
||||||
|
|
||||||
If the preprocessor macro @code{NDEBUG} is defined before
|
|
||||||
@file{assert.h} is included, the @code{assert} macro is defined to do
|
|
||||||
absolutely nothing. Even the argument expression @var{expression} is
|
|
||||||
not evaluated, so you should avoid calling @code{assert} with arguments
|
|
||||||
that involve side effects.
|
|
||||||
|
|
||||||
For example, @code{assert (++i > 0);} is a bad idea, because @code{i}
|
|
||||||
will not be incremented if @code{NDEBUG} is defined.
|
|
||||||
@end deftypefn
|
|
||||||
|
|
||||||
Sometimes the ``impossible'' condition you want to check for is an error
|
|
||||||
return from an operating system function. Then it is useful to display
|
|
||||||
not only where the program crashes, but also what error was returned.
|
|
||||||
The @code{assert_perror} macro makes this easy.
|
|
||||||
|
|
||||||
@comment assert.h
|
|
||||||
@comment GNU
|
|
||||||
@deftypefn Macro void assert_perror (int @var{errnum})
|
|
||||||
Similar to @code{assert}, but verifies that @var{errnum} is zero.
|
|
||||||
|
|
||||||
If @code{NDEBUG} is defined, @code{assert_perror} tests the value of
|
|
||||||
@var{errnum}. If it is nonzero, @code{assert_perror} aborts the program
|
|
||||||
after a printing a message of the form:
|
|
||||||
|
|
||||||
@smallexample
|
|
||||||
@file{@var{file}}:@var{linenum}: @var{function}: @var{error text}
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
@noindent
|
|
||||||
on the standard error stream. The file name, line number, and function
|
|
||||||
name are as for @code{assert}. The error text is the result of
|
|
||||||
@w{@code{strerror (@var{errnum})}}. @xref{Error Messages}.
|
|
||||||
|
|
||||||
Like @code{assert}, if @code{NDEBUG} is defined before @file{assert.h}
|
|
||||||
is included, the @code{assert_perror} macro does absolutely nothing. It
|
|
||||||
does not evaluate the argument, so @var{errnum} should not have any side
|
|
||||||
effects. It is best for @var{errnum} to be a just simple variable
|
|
||||||
reference; often it will be @code{errno}.
|
|
||||||
|
|
||||||
This macro is a GNU extension.
|
|
||||||
@end deftypefn
|
|
||||||
|
|
||||||
@strong{Usage note:} The @code{assert} facility is designed for
|
|
||||||
detecting @emph{internal inconsistency}; it is not suitable for
|
|
||||||
reporting invalid input or improper usage.
|
|
||||||
|
|
||||||
The information in the diagnostic messages provided by the @code{assert}
|
|
||||||
macro is intended to to help you, the programmer, track down the cause
|
|
||||||
of a bug, but is not really useful in telling a user of your program why
|
|
||||||
his or her input was invalid or why a command could not be carried out.
|
|
||||||
So you can't use @code{assert} to print the error messages for these
|
|
||||||
eventualities.
|
|
||||||
|
|
||||||
What's more, your program should not abort when given invalid input, as
|
|
||||||
@code{assert} would do---it should exit with nonzero status after
|
|
||||||
printing its error messages, or perhaps read another command or move
|
|
||||||
on to the next input file.
|
|
||||||
|
|
||||||
@xref{Error Messages}, for information on printing error messages for
|
|
||||||
problems that @emph{do not} represent bugs in the program.
|
|
||||||
|
|
@ -11,7 +11,7 @@ features has been written, we are publishing it here.
|
|||||||
* Consistency Checking:: Using @code{assert} to abort if
|
* Consistency Checking:: Using @code{assert} to abort if
|
||||||
something ``impossible'' happens.
|
something ``impossible'' happens.
|
||||||
* Variadic Functions:: Defining functions with varying numbers
|
* Variadic Functions:: Defining functions with varying numbers
|
||||||
of args.
|
of args.
|
||||||
* Null Pointer Constant:: The macro @code{NULL}.
|
* Null Pointer Constant:: The macro @code{NULL}.
|
||||||
* Important Data Types:: Data types for object sizes.
|
* Important Data Types:: Data types for object sizes.
|
||||||
* Data Type Measurements:: Parameters of data type representations.
|
* Data Type Measurements:: Parameters of data type representations.
|
||||||
@ -25,8 +25,8 @@ features has been written, we are publishing it here.
|
|||||||
|
|
||||||
When you're writing a program, it's often a good idea to put in checks
|
When you're writing a program, it's often a good idea to put in checks
|
||||||
at strategic places for ``impossible'' errors or violations of basic
|
at strategic places for ``impossible'' errors or violations of basic
|
||||||
assumptions. These checks are helpful in debugging problems due to
|
assumptions. These kinds of checks are helpful in debugging problems
|
||||||
misunderstandings between different parts of the program.
|
with the interfaces between different parts of the program, for example.
|
||||||
|
|
||||||
@pindex assert.h
|
@pindex assert.h
|
||||||
The @code{assert} macro, defined in the header file @file{assert.h},
|
The @code{assert} macro, defined in the header file @file{assert.h},
|
||||||
@ -57,16 +57,19 @@ program (@pxref{Aborting a Program}) after printing a message of the
|
|||||||
form:
|
form:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
@file{@var{file}}:@var{linenum}: Assertion `@var{expression}' failed.
|
@file{@var{file}}:@var{linenum}: @var{function}: Assertion `@var{expression}' failed.
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
on the standard error stream @code{stderr} (@pxref{Standard Streams}).
|
on the standard error stream @code{stderr} (@pxref{Standard Streams}).
|
||||||
The filename and line number are taken from the C preprocessor macros
|
The filename and line number are taken from the C preprocessor macros
|
||||||
@code{__FILE__} and @code{__LINE__} and specify where the call to
|
@code{__FILE__} and @code{__LINE__} and specify where the call to
|
||||||
@code{assert} was written.
|
@code{assert} was written. When using the GNU C compiler, the name of
|
||||||
|
the function which calls @code{assert} is taken from the built-in
|
||||||
|
variable @code{__PRETTY_FUNCTION__}; with older compilers, the function
|
||||||
|
name and following colon are omitted.
|
||||||
|
|
||||||
If the preprocessor macro @code{NDEBUG} is defined at the point where
|
If the preprocessor macro @code{NDEBUG} is defined before
|
||||||
@file{assert.h} is included, the @code{assert} macro is defined to do
|
@file{assert.h} is included, the @code{assert} macro is defined to do
|
||||||
absolutely nothing.
|
absolutely nothing.
|
||||||
|
|
||||||
@ -77,6 +80,38 @@ with arguments that involve side effects. For example, @code{assert
|
|||||||
@code{NDEBUG} is defined.
|
@code{NDEBUG} is defined.
|
||||||
@end deftypefn
|
@end deftypefn
|
||||||
|
|
||||||
|
Sometimes the ``impossible'' condition you want to check for is an error
|
||||||
|
return from an operating system function. Then it is useful to display
|
||||||
|
not only where the program crashes, but also what error was returned.
|
||||||
|
The @code{assert_perror} macro makes this easy.
|
||||||
|
|
||||||
|
@comment assert.h
|
||||||
|
@comment GNU
|
||||||
|
@deftypefn Macro void assert_perror (int @var{errnum})
|
||||||
|
Similar to @code{assert}, but verifies that @var{errnum} is zero.
|
||||||
|
|
||||||
|
If @code{NDEBUG} is defined, @code{assert_perror} tests the value of
|
||||||
|
@var{errnum}. If it is nonzero, @code{assert_perror} aborts the program
|
||||||
|
after a printing a message of the form:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
@file{@var{file}}:@var{linenum}: @var{function}: @var{error text}
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
on the standard error stream. The file name, line number, and function
|
||||||
|
name are as for @code{assert}. The error text is the result of
|
||||||
|
@w{@code{strerror (@var{errnum})}}. @xref{Error Messages}.
|
||||||
|
|
||||||
|
Like @code{assert}, if @code{NDEBUG} is defined before @file{assert.h}
|
||||||
|
is included, the @code{assert_perror} macro does absolutely nothing. It
|
||||||
|
does not evaluate the argument, so @var{errnum} should not have any side
|
||||||
|
effects. It is best for @var{errnum} to be a just simple variable
|
||||||
|
reference; often it will be @code{errno}.
|
||||||
|
|
||||||
|
This macro is a GNU extension.
|
||||||
|
@end deftypefn
|
||||||
|
|
||||||
@strong{Usage note:} The @code{assert} facility is designed for
|
@strong{Usage note:} The @code{assert} facility is designed for
|
||||||
detecting @emph{internal inconsistency}; it is not suitable for
|
detecting @emph{internal inconsistency}; it is not suitable for
|
||||||
reporting invalid input or improper usage by @emph{the user} of the
|
reporting invalid input or improper usage by @emph{the user} of the
|
||||||
@ -86,8 +121,8 @@ The information in the diagnostic messages printed by the @code{assert}
|
|||||||
macro is intended to help you, the programmer, track down the cause of a
|
macro is intended to help you, the programmer, track down the cause of a
|
||||||
bug, but is not really useful for telling a user of your program why his
|
bug, but is not really useful for telling a user of your program why his
|
||||||
or her input was invalid or why a command could not be carried out. So
|
or her input was invalid or why a command could not be carried out. So
|
||||||
you can't use @code{assert} to print the error messages for these
|
you can't use @code{assert} or @code{assert_perror} to print the error
|
||||||
eventualities.
|
messages for these eventualities.
|
||||||
|
|
||||||
What's more, your program should not abort when given invalid input, as
|
What's more, your program should not abort when given invalid input, as
|
||||||
@code{assert} would do---it should exit with nonzero status (@pxref{Exit
|
@code{assert} would do---it should exit with nonzero status (@pxref{Exit
|
||||||
@ -120,7 +155,7 @@ of arguments, using @file{varargs.h}.
|
|||||||
|
|
||||||
@menu
|
@menu
|
||||||
* Why Variadic:: Reasons for making functions take
|
* Why Variadic:: Reasons for making functions take
|
||||||
variable arguments.
|
variable arguments.
|
||||||
* How Variadic:: How to define and call variadic functions.
|
* How Variadic:: How to define and call variadic functions.
|
||||||
* Variadic Example:: A complete example.
|
* Variadic Example:: A complete example.
|
||||||
@end menu
|
@end menu
|
||||||
@ -189,7 +224,7 @@ additional variable arguments. @xref{Calling Variadics}.
|
|||||||
with variable arguments.
|
with variable arguments.
|
||||||
* Receiving Arguments:: Steps you must follow to access the
|
* Receiving Arguments:: Steps you must follow to access the
|
||||||
optional argument values.
|
optional argument values.
|
||||||
* How Many Arguments:: How to decide whether there are more arguments.
|
* How Many Arguments:: How to decide whether there are more arguments.
|
||||||
* Calling Variadics:: Things you need to know about calling
|
* Calling Variadics:: Things you need to know about calling
|
||||||
variable arguments functions.
|
variable arguments functions.
|
||||||
* Argument Macros:: Detailed specification of the macros
|
* Argument Macros:: Detailed specification of the macros
|
||||||
@ -205,16 +240,16 @@ additional variable arguments. @xref{Calling Variadics}.
|
|||||||
|
|
||||||
A function that accepts a variable number of arguments must be declared
|
A function that accepts a variable number of arguments must be declared
|
||||||
with a prototype that says so. You write the fixed arguments as usual,
|
with a prototype that says so. You write the fixed arguments as usual,
|
||||||
and then tack on @samp{@dots{}} to indicate the possibility of
|
and then tack on @samp{@dots{}} to indicate the possibility of
|
||||||
additional arguments. The syntax of ANSI C requires at least one fixed
|
additional arguments. The syntax of ANSI C requires at least one fixed
|
||||||
argument before the @samp{@dots{}}. For example,
|
argument before the @samp{@dots{}}. For example,
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
int
|
int
|
||||||
func (const char *a, int b, @dots{})
|
func (const char *a, int b, @dots{})
|
||||||
@{
|
@{
|
||||||
@dots{}
|
@dots{}
|
||||||
@}
|
@}
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
@ -271,7 +306,7 @@ compiler. But you might as well call @code{va_end} just in case your
|
|||||||
program is someday compiled with a peculiar compiler.)
|
program is someday compiled with a peculiar compiler.)
|
||||||
@end enumerate
|
@end enumerate
|
||||||
|
|
||||||
@xref{Argument Macros}, for the full definitions of @code{va_start},
|
@xref{Argument Macros}, for the full definitions of @code{va_start},
|
||||||
@code{va_arg} and @code{va_end}.
|
@code{va_arg} and @code{va_end}.
|
||||||
|
|
||||||
Steps 1 and 3 must be performed in the function that accepts the
|
Steps 1 and 3 must be performed in the function that accepts the
|
||||||
@ -405,7 +440,7 @@ found in the header file @file{varargs.h}.
|
|||||||
@deftypefn {Macro} @var{type} va_arg (va_list @var{ap}, @var{type})
|
@deftypefn {Macro} @var{type} va_arg (va_list @var{ap}, @var{type})
|
||||||
The @code{va_arg} macro returns the value of the next optional argument,
|
The @code{va_arg} macro returns the value of the next optional argument,
|
||||||
and modifies the value of @var{ap} to point to the subsequent argument.
|
and modifies the value of @var{ap} to point to the subsequent argument.
|
||||||
Thus, successive uses of @code{va_arg} return successive optional
|
Thus, successive uses of @code{va_arg} return successive optional
|
||||||
arguments.
|
arguments.
|
||||||
|
|
||||||
The type of the value returned by @code{va_arg} is @var{type} as
|
The type of the value returned by @code{va_arg} is @var{type} as
|
||||||
@ -478,7 +513,7 @@ functions:
|
|||||||
@comment Unix
|
@comment Unix
|
||||||
@deffn Macro va_alist
|
@deffn Macro va_alist
|
||||||
This macro stands for the argument name list required in a variadic
|
This macro stands for the argument name list required in a variadic
|
||||||
function.
|
function.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@comment varargs.h
|
@comment varargs.h
|
||||||
@ -537,7 +572,7 @@ The result of subtracting two pointers in C is always an integer, but the
|
|||||||
precise data type varies from C compiler to C compiler. Likewise, the
|
precise data type varies from C compiler to C compiler. Likewise, the
|
||||||
data type of the result of @code{sizeof} also varies between compilers.
|
data type of the result of @code{sizeof} also varies between compilers.
|
||||||
ANSI defines standard aliases for these two types, so you can refer to
|
ANSI defines standard aliases for these two types, so you can refer to
|
||||||
them in a portable fashion. They are defined in the header file
|
them in a portable fashion. They are defined in the header file
|
||||||
@file{stddef.h}.
|
@file{stddef.h}.
|
||||||
@pindex stddef.h
|
@pindex stddef.h
|
||||||
|
|
||||||
@ -601,7 +636,7 @@ which give you this information in full detail.
|
|||||||
* Width of Type:: How many bits does an integer type hold?
|
* Width of Type:: How many bits does an integer type hold?
|
||||||
* Range of Type:: What are the largest and smallest values
|
* Range of Type:: What are the largest and smallest values
|
||||||
that an integer type can hold?
|
that an integer type can hold?
|
||||||
* Floating Type Macros:: Parameters that measure the floating point types.
|
* Floating Type Macros:: Parameters that measure the floating point types.
|
||||||
* Structure Measurement:: Getting measurements on structure types.
|
* Structure Measurement:: Getting measurements on structure types.
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@ -814,7 +849,7 @@ machine.
|
|||||||
* Floating Point Concepts:: Definitions of terminology.
|
* Floating Point Concepts:: Definitions of terminology.
|
||||||
* Floating Point Parameters:: Details of specific macros.
|
* Floating Point Parameters:: Details of specific macros.
|
||||||
* IEEE Floating Point:: The measurements for one common
|
* IEEE Floating Point:: The measurements for one common
|
||||||
representation.
|
representation.
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@node Floating Point Concepts
|
@node Floating Point Concepts
|
||||||
@ -865,7 +900,7 @@ follows.
|
|||||||
The @dfn{mantissa} or @dfn{significand}, an unsigned integer which is a
|
The @dfn{mantissa} or @dfn{significand}, an unsigned integer which is a
|
||||||
part of each floating point number.
|
part of each floating point number.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
@cindex precision (of floating point number)
|
@cindex precision (of floating point number)
|
||||||
The @dfn{precision} of the mantissa. If the base of the representation
|
The @dfn{precision} of the mantissa. If the base of the representation
|
||||||
is @var{b}, then the precision is the number of base-@var{b} digits in
|
is @var{b}, then the precision is the number of base-@var{b} digits in
|
||||||
@ -1149,7 +1184,7 @@ supposed to be greater than @code{1E-9}.
|
|||||||
|
|
||||||
@node IEEE Floating Point
|
@node IEEE Floating Point
|
||||||
@subsubsection IEEE Floating Point
|
@subsubsection IEEE Floating Point
|
||||||
@cindex IEEE floating point representation
|
@cindex IEEE floating point representation
|
||||||
@cindex floating point, IEEE
|
@cindex floating point, IEEE
|
||||||
|
|
||||||
Here is an example showing how the floating type measurements come out
|
Here is an example showing how the floating type measurements come out
|
||||||
|
@ -52,7 +52,7 @@ routines := brk sbrk sstk ioctl \
|
|||||||
syslog syscall daemon \
|
syslog syscall daemon \
|
||||||
mmap munmap mprotect msync madvise \
|
mmap munmap mprotect msync madvise \
|
||||||
efgcvt efgcvt_r \
|
efgcvt efgcvt_r \
|
||||||
hsearch hsearch_r tsearch \
|
hsearch hsearch_r tsearch lsearch \
|
||||||
err error
|
err error
|
||||||
aux := init-misc
|
aux := init-misc
|
||||||
distribute := bsd-compat.c
|
distribute := bsd-compat.c
|
||||||
|
@ -45,7 +45,7 @@ mo-installed = $(localedir)/%/LC_MESSAGES/$(domainname).mo
|
|||||||
install-others = $(LINGUAS:%=$(mo-installed))
|
install-others = $(LINGUAS:%=$(mo-installed))
|
||||||
|
|
||||||
# Files to distribute: all the source and compiled binary translation files.
|
# Files to distribute: all the source and compiled binary translation files.
|
||||||
distribute = $(ALL_LINGUAS:=.po) $(ALL_LINGUAS:=.mo)
|
distribute = $(ALL_LINGUAS:=.po) $(ALL_LINGUAS:=.mo) SYS_libc.pot
|
||||||
|
|
||||||
|
|
||||||
include ../Rules
|
include ../Rules
|
||||||
|
@ -25,7 +25,7 @@ headers := string.h strings.h memory.h endian.h bytesex.h \
|
|||||||
argz.h envz.h
|
argz.h envz.h
|
||||||
|
|
||||||
routines := strcat strchr strcmp strcoll strcpy strcspn strdup \
|
routines := strcat strchr strcmp strcoll strcpy strcspn strdup \
|
||||||
strerror _strerror strlen strnlen \
|
strerror _strerror strerror_r strlen strnlen \
|
||||||
strncat strncmp strncpy \
|
strncat strncmp strncpy \
|
||||||
strrchr strpbrk strsignal strspn strstr strtok \
|
strrchr strpbrk strsignal strspn strstr strtok \
|
||||||
strtok_r strxfrm memchr memcmp memmove memset \
|
strtok_r strxfrm memchr memcmp memmove memset \
|
||||||
|
@ -157,7 +157,7 @@ extern char *strerror __P ((int __errnum));
|
|||||||
#ifdef __USE_REENTRANT
|
#ifdef __USE_REENTRANT
|
||||||
/* Reentrant version of `strerror'. If a temporary buffer is required, at
|
/* Reentrant version of `strerror'. If a temporary buffer is required, at
|
||||||
most BUFLEN bytes of BUF will be used. */
|
most BUFLEN bytes of BUF will be used. */
|
||||||
extern char *strerror_r __P ((int __errnum, char *__buf, int __buflen));
|
extern char *strerror_r __P ((int __errnum, char *__buf, size_t __buflen));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __USE_BSD
|
#ifdef __USE_BSD
|
||||||
|
@ -2,3 +2,4 @@ setjmp_aux.c
|
|||||||
DEFS.h
|
DEFS.h
|
||||||
divrem.h
|
divrem.h
|
||||||
divl.S divlu.S divq.S divqu.S reml.S remlu.S remq.S remqu.S
|
divl.S divlu.S divq.S divqu.S reml.S remlu.S remq.S remqu.S
|
||||||
|
_mcount.S
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
# Cambridge, MA 02139, USA.
|
# Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
ifeq ($(subdir),gmon)
|
ifeq ($(subdir),gmon)
|
||||||
sysdep_routines := bb_init_func _mcount
|
sysdep_routines += _mcount
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(subdir),setjmp)
|
ifeq ($(subdir),setjmp)
|
||||||
|
@ -2,3 +2,4 @@ errnos-tmpl.c errnos.awk
|
|||||||
ioctls-tmpl.c ioctls.awk snarf-ioctls
|
ioctls-tmpl.c ioctls.awk snarf-ioctls
|
||||||
make_errlist.c
|
make_errlist.c
|
||||||
mk-local_lim.c
|
mk-local_lim.c
|
||||||
|
s-proto.S
|
||||||
|
@ -1,78 +0,0 @@
|
|||||||
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Library General Public License as
|
|
||||||
published by the Free Software Foundation; either version 2 of the
|
|
||||||
License, or (at your option) any later version.
|
|
||||||
|
|
||||||
The GNU C Library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
|
||||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
|
||||||
Cambridge, MA 02139, USA. */
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/param.h>
|
|
||||||
|
|
||||||
/* Generate local_limits.h from <sys/param.h> values for BSD. */
|
|
||||||
|
|
||||||
struct param
|
|
||||||
{
|
|
||||||
char *name;
|
|
||||||
int value;
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct param params[] =
|
|
||||||
{
|
|
||||||
{ "NGROUPS_MAX", NGROUPS },
|
|
||||||
|
|
||||||
{ "ARG_MAX", NCARGS },
|
|
||||||
|
|
||||||
#ifdef MAXUPRC
|
|
||||||
{ "CHILD_MAX", MAXUPRC },
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{ "OPEN_MAX", NOFILE },
|
|
||||||
|
|
||||||
/* Apparently, Ultrix's <sys/param.h> defines LINK_MAX and not MAXLINK. */
|
|
||||||
#if defined (LINK_MAX) && !defined (MAXLINK)
|
|
||||||
#define MAXLINK LINK_MAX
|
|
||||||
#endif
|
|
||||||
#ifdef MAXLINK
|
|
||||||
{ "LINK_MAX", MAXLINK },
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{ "MAX_CANON", CANBSIZ },
|
|
||||||
|
|
||||||
#ifndef MAXNAMLEN
|
|
||||||
#define MAXNAMLEN 255
|
|
||||||
#endif
|
|
||||||
{ "NAME_MAX", MAXNAMLEN },
|
|
||||||
|
|
||||||
{ "PATH_MAX", MAXPATHLEN },
|
|
||||||
|
|
||||||
{ NULL, 0 }
|
|
||||||
};
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
extern char *ctime();
|
|
||||||
extern time_t time();
|
|
||||||
time_t now = time((time_t *) NULL);
|
|
||||||
register struct param *p;
|
|
||||||
|
|
||||||
printf("\
|
|
||||||
/* Implementation-specific limits.\n\
|
|
||||||
Generated at %.25s. */\n\n", ctime(&now));
|
|
||||||
|
|
||||||
for (p = params; p->name != NULL; ++p)
|
|
||||||
printf("#define %s %d\n", p->name, p->value);
|
|
||||||
|
|
||||||
exit(0);
|
|
||||||
}
|
|
3
sysdeps/unix/sysv/linux/alpha/Dist
Normal file
3
sysdeps/unix/sysv/linux/alpha/Dist
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
alpha/ptrace.h alpha/regdef.h
|
||||||
|
ieee_get_fp_control.S ieee_set_fp_control.S
|
||||||
|
ioperm.c
|
Loading…
Reference in New Issue
Block a user