Commit Graph

156 Commits

Author SHA1 Message Date
christos e86a6cb1b4 Add getenv_r and ttyname_r 2005-09-25 20:08:15 +00:00
christos 66412e7240 compat code reorg 2005-09-13 01:44:32 +00:00
christos 5b18fe838f PR/30503: Nicolas Joly: swapctl(2) prototype does not match corresponding
syscall
2005-06-11 22:54:43 +00:00
kleink 484c40cd9f Remove the compatibility select() prototype. Going back to Lite2 select(2)
has also mandated <sys/time.h> to be included, which is now sufficient
for the prototype and all related declarations; thus the local duplicate
of the prototype can be removed.  Approved by Christos.
2005-05-22 19:10:15 +00:00
kleink 1c7e2b47c4 Provide select() and pselect() prototypes in <sys/select.h>, per
1003.1-2001, and leave the select() prototype in <unistd.h> for
compatibility.  To allow for transition, reorganization of this is
deferred until netbsd-3 gets branched.
2005-03-05 19:48:38 +00:00
perry 19b7469a00 de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.
2005-02-03 04:39:32 +00:00
lukem a3665ef9cf Implement getgroupmembership(3). This is similar to getgrouplist(3), except
that the "int maxgroups" and "int *ngroups" parameters are separated into
two separate parameters which makes it possible to call multiple nsswitch
back-ends and have the results correctly merged.
getgrouplist(3) is now implemented using getgroupmembership(3).

Proposed on tech-userlevel on December 1, 2004.
2005-01-06 15:10:45 +00:00
kleink a95e31fea6 Move declaration of closefrom(3) to local extensions. 2004-06-01 16:10:29 +00:00
itojun 56c1b44159 implement closefrom(3). 2004-05-31 05:06:51 +00:00
kleink 8df3999b0c While I'm at it: add restrict qualifiers to readlink(2). 2004-05-10 22:33:08 +00:00
kleink 43b7ae77fa POSIX-2001: Change readlink(2)'s return type from int to ssize_t. 2004-05-10 22:28:23 +00:00
thorpej 137c808bb8 Userland portion of fsync_range(2), written by Bill Studenmund, and
contributed by Wasabi Systems, Inc.
2003-11-18 00:56:56 +00:00
agc 039cc95684 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22270, verified by myself.
2003-08-07 09:44:09 +00:00
kristerw c1f62bbe29 Do not give names to the parameters in function prototypes (those names
reduces the usefulness of the gcc -Wshadow flag).
2003-07-08 01:43:28 +00:00
bjh21 4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
kleink 8c5e6bc1d8 Well, _The_ Open Group. 2003-04-14 08:38:24 +00:00
kleink c9e531d4d4 Use the real TOG specification name for references. 2003-04-14 08:37:29 +00:00
jdolecek e75e2e6438 seteuid() and setegid() were adopted in IEEE Std 1003.1-2001 + X/Open
portability guide issue 6, adjust headers to expose the function
prototypes with appropriate _POSIX_C_SOURCE/_XOPEN_SOURCE defines
fixes standards/21136 by MAEKAWA Masahide
2003-04-14 08:12:11 +00:00
wiz ed54ccdc86 Remove variable name from prototype.
Reported by John Heasley on current-users on 29 July 2001.
2001-07-29 22:18:45 +00:00
kleink 5b5aa6f77e Avoid trad. cpp recursion in intptr_t definition. 2001-07-18 10:18:21 +00:00
christos 8939b770e2 protect against multiple declarations. 2000-12-18 21:22:00 +00:00
kleink 83b6632673 Define intptr_t and uintptr_t via <machine/int_types.h>. 2000-06-27 05:51:54 +00:00
minoura 599d65f132 New syscall issetugid. 2000-04-21 16:24:22 +00:00
christos 2effe6c79a backout previous. the definition of struct option caused too many namespace
collisions. Instead, define getopt_long in getopt.h and getopt in unistd.h
where it belongs.
2000-04-02 06:32:41 +00:00
christos a91d8b9ec7 Add getopt.h and collect all the getopt related stuff here.
Make unistd.h include <getopt.h> to get the getopt stuff.
This adds support for getopt_long from Dieter Baron and Thomas Klausner.
2000-04-01 22:37:14 +00:00
itojun 5b1aaa939e add IPv6 support to rcmd() and friends.
rcmd() and iruserok(): unchanged
	ruserok(): became address family independent
	rcmd_af(), iruesrok_sa(): address family independent
2000-01-27 05:33:06 +00:00
kleink 1bba558e50 Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.
2000-01-10 16:58:38 +00:00
kleink c07f17e8d9 For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above.  As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.
1999-12-22 21:26:15 +00:00
kleink 087b539e0f Change the declaration of the argv argument to getopt(3) from "char * const *"
(as originally declared in System V) to "char * const []", as was done in
1003.2 and subsequently propagated into XPG4.
From Andrew Cagney in PR lib/8930.
1999-12-02 13:15:55 +00:00
kleink e79a283e47 XSH5: change function signature to `void *sbrk(intptr_t)'. 1999-07-12 21:55:19 +00:00
kleink 2ae70ac652 Move IPv6-related declarations into the implementation-defined domain. 1999-07-03 13:22:06 +00:00
itojun 10f59f2d42 define IPv6 library functions and structures, as defined in
RFC2292 and RFC2553.
define internal state structure for IPv6-transport resolver.

Commits for source code will follow.
1999-07-01 18:15:41 +00:00
kleink d7499b21b3 #ifdef __STDC__ -> #if __STDC__ 1999-04-20 20:15:47 +00:00
sommerfe bb8c6c869a move __getcwd prototypes to libc-private header file.
XXX duplicate the prototype in getcwd regression test (which needs to
call the syscall directly for reasonably complete testing).
1999-03-26 22:23:57 +00:00
sommerfe 80729aa7de Add fchroot, getcwd 1999-03-22 17:59:08 +00:00
kleink e2a4add9f7 brk(2) actually returns an int indicating success (0) or failure (-1). Also,
change its argument to void *.  (Both XSH5).
1999-03-09 20:33:22 +00:00
kleink 13bbe6c70e G/C orphaned unwhiteout() prototype. 1999-03-09 12:46:22 +00:00
thorpej 82865be7fd Change the type of sys_siglist and sys_signame from const char *const [] to
const char *const *, and rename them to __sys_siglist14 and __sys_signame14.
This will prevent the size of the exported symbol from changing when more
signals are added to the list.
1998-11-30 20:36:27 +00:00
kleink 46269c5996 getpgid() is XPG4.2, actually. 1998-11-09 12:45:11 +00:00
mrg 32e9822211 add a prototype for getpgid (missing for years!) 1998-11-06 05:58:09 +00:00
mycroft f886615650 __Namespace__ __protection__. 1998-07-30 00:44:15 +00:00
mycroft a6b6f620db Sprinkle in some __attribute__((noreturn))s. 1998-07-28 00:28:29 +00:00
mycroft 29916a94a6 Slight rearrangement. 1998-07-27 11:09:19 +00:00
mycroft ab22ce8def If __AUDIT__ is defined, remove some traditional interfaces: gets, sprintf,
vsprintf, tempnam, mktemp, getwd.
1998-07-27 09:58:49 +00:00
mycroft 4f4968a946 Mark more functions returning internal buffers for const auditing. 1998-07-27 09:33:44 +00:00
mycroft 633b8f45a9 Make many of the new consts dependent on a new `__AUDIT__' flag, to avoid
breaking third party software.  *sigh*
1998-07-27 09:09:03 +00:00
mycroft 74d731feba KNF nit. 1998-07-26 19:20:55 +00:00
mycroft 4024f73640 const poisoning. 1998-07-26 13:34:18 +00:00
kleink 901ea16862 Addendum to previous change: since pread()'s and pwrite()'s first official
appearance was in X/Open CAE Spec Issue 5 Version 2, add a section for that
and move the prototypes there.
1998-07-02 21:20:54 +00:00
thorpej c0f28f93e4 Prototype pread(2) and pwrite(2) if !defined(_POSIX_C_SOURCE). 1998-06-30 19:46:41 +00:00
kleink 4a8b801d9d Add a prototype for fdatasync(2). 1998-06-05 20:45:39 +00:00
kleink f39087367a * Reorganize name space protection.
* Remove mknod() prototype; it's located in <sys/stat.h> (XPG4.2).
* Remove re_comp() and re_exec() prototypes; their location is <re_comp.h>
  (XPG4.2).
* Move setkey() prototype to <stdlib.h> (XPG4).
* Move mkstemp(), mktemp(), ttyslot() and valloc() prototypes to <stdlib.h>
  (XPG4.2).
Assign copyright to TNF.
1998-06-01 20:06:45 +00:00
kleink 9436b9b06b Make the rename() prototype available to XPG Issue <=3 applications only; the
canonical header for the prototype has been <stdio.h> for quite a while.
1998-05-24 19:13:56 +00:00
kleink 485ed6437f Change the type of the `namelen' argument of gethostname(), getdomainname(),
sethostname(), setdomainname() from int to size_t.  The former change was
made due to an X/Open XNS5 requirement, the latter three were made for
consistency.
1998-05-06 19:59:35 +00:00
kleink 3a1500efe9 Per X/Open CAE Spec Issue 5 Version 2, change the buffer size argument of
readlink() from type `int' to type `size_t'.  This isn't an ABI change, since
the calling convention of our only LP64 platform (the Alpha) already promotes
this argument to a `long'.

This may not be the final action on this matter; readlink() still returns
an `int', which may change in a future revision of the standard.
1998-03-27 13:02:20 +00:00
thorpej 31e20a3875 Prototype getsid(). 1998-02-18 18:24:26 +00:00
kleink c0dde81ddb If standards-compliance is requested by defining the preprocessor symbols
_POSIX_SOURCE or _XOPEN_SOURCE at compile time, use __RENAME() to call
__posix_chown(), __posix_fchown(), __posix_lchown() and __posix_rename()
instead of their NetBSD counterparts in order to remove the requirement of
linking against libposix.
1998-02-14 20:39:26 +00:00
perry b7b7322c68 merge lite-2 1998-02-02 21:07:13 +00:00
kleink f1d296dd60 Per XPG4, move the prototype of swab() from <string.h> to <unistd.h>. 1998-01-12 16:05:40 +00:00
thorpej 4a7fabf18c Update for __vfork14(). 1998-01-05 06:14:51 +00:00
kleink 916831ec4e Add lockf(), an alternate interface to perform advisory record locking;
per XPG4.2.
1997-12-20 20:23:15 +00:00
kleink 6598e022b2 Per XPG4.2, use useconds_t for as argument and return type of ualarm(). 1997-11-25 17:57:37 +00:00
kleink d92a29c3b7 Per XPG4.2, change usleep() to take an useconds_t as its argument, and return
an int.
1997-11-24 19:09:19 +00:00
kleink ae0ad1a554 Per XPG4.2, move mknod() prototype from <unistd.h> to <sys/stat.h>. 1997-11-02 17:16:48 +00:00
christos 3664382e53 move setmode and strsignal to unistd.h 1997-10-16 23:26:24 +00:00
mikel 3794b425f3 proto lchown() only if !_POSIX_SOURCE 1997-10-08 05:44:22 +00:00
enami 42aa3a4327 Declare prototype of lchown(2). 1997-10-06 01:43:21 +00:00
christos b2b50d955b Backout addition of user_from_uid and group_from_gid; they exist in pwd.h
and grp.h [pointed by cgd]
1997-07-20 19:18:49 +00:00
christos cf8c0114c2 Add user_from_uid and group_from_gid 1997-07-20 19:06:07 +00:00
christos 2b322cb844 Add missing swapon prototype and mark it obsolete. 1997-07-13 18:12:49 +00:00
kleink 8470989b67 Common sense dictates that the `basegid' paramater of initgroups(3) should
be of type gid_t, and not int.
1997-07-04 09:14:52 +00:00
mrg cab9e1c2f8 oops, forgot to commit this. prototype swapctl() in place of swapon(). 1997-06-23 01:13:43 +00:00
christos b13a0cea18 Add missing prototype for getgrouplist as mentioned in the man page. 1997-05-09 19:38:32 +00:00
cgd 1530406723 __syscall() should return quad_t, not int; what was i thinking? 1996-12-21 01:30:48 +00:00
cgd 9974d54108 sethostid returns int not void, also add prototype for __syscall that
matches manual page.
1996-12-20 19:33:56 +00:00
mycroft 7a494f5540 Don't prototype poll(2) here. SysV requires poll.h to be included. 1996-09-07 17:48:59 +00:00
mycroft 4723d5537c Prototype poll(2). 1996-09-07 14:30:56 +00:00
mrg 74693079c6 update for new reboot(2). 1996-08-09 10:32:11 +00:00
mycroft 20ba5e02de Declare setre[ug]id() to take [ug]id_t args. No functional difference. 1996-06-23 11:56:25 +00:00
mrg 343a54bb75 Change iuserok() to take u_int32_t. Some netgroup fixes (partially
from OpenBSD and Theo).
1996-05-28 02:07:32 +00:00
cgd a2ce90f34c change definition of profil() to make it 64-bit friendly. This has
no practical consequence on 32-bit systems.  old prototype was
int profil(char *, int, int, int), and new one is int profile(char *,
size_t, u_long, u_int).  the size_t is the size of the buffer,
and the u_long is the 'starting offset'.  (I changed the last int
to u_int, because it's treated as a u_int everywhere, and isn't
logically a signed value.)
1995-11-22 23:07:19 +00:00
mycroft 00d5ad1f8a Make definitions of psignal() and sys_siglist match signal.h. 1995-03-19 22:51:38 +00:00
mycroft 6e6e7be7b8 Add prototypes for undelete(2). 1994-12-28 04:40:28 +00:00
cgd 2ba9a0c114 proto for iruserok. 1994-12-23 15:04:05 +00:00
cgd 4d2cbfce0a new RCS ID format. 1994-10-26 00:55:40 +00:00
cgd 0b201aeb5b better attributes. 1994-10-19 03:44:57 +00:00
mycroft d7603a1f35 NFS changes. 1994-06-08 11:59:55 +00:00
cgd b1e1a26f9b kill *chflags protos 1994-05-23 00:32:32 +00:00
jtc 6abbb15be4 add new getopt(3) extern variable optreset 1994-05-07 00:20:42 +00:00
jtc 0691b2fcae Last weekend's uid_t & gid_t changes allow us to change the uid & gid
arguments to fchown from ints to a uid_t and a gid_t.
1994-03-29 02:53:54 +00:00
jtc 2b5fbfd760 Last weekend's gid_t changes allow us to change the gidset argument of
getgroups() and setgroups() from a int ptr to a gid_t ptr.
1994-03-29 02:44:37 +00:00
cgd 612244f3b8 match 4.4's definitions for sys_siglist and sys_signame 1994-01-25 23:16:54 +00:00
cgd a9995150b9 vfork() return type pid_t. reported by Peter Galbavy.
Also, whoever did the re-indenting in this file needs to be shot;
things shouldn't be indented by "tab-space"...
1993-12-30 04:11:56 +00:00
mycroft 504c62c073 Add `const's to sys_siglist and sys_signame decls. 1993-12-02 09:50:34 +00:00
jtc d208b02924 Change prototypes of alarm and sleep to use "unsigned" instead of "u_int".
"u_int" is not defined by <sys/types.h> in a strict POSIX environment.
1993-10-14 23:15:26 +00:00
jtc 1b75821c58 Declare getopt(), getsubopt() and their external variables.
Still work to be done to handle all the combinations of _POSIX_SOURCE, and
_POSIX2_SOURCE, etc. to allow the user to select a strictly conforming
compilation environment, but this change allows us to transition
getopt() out of <stdlib.h>.
1993-10-13 18:22:06 +00:00
jtc d3e27287c9 POSIX.1 says that ssize_t is defined in <sys/types.h>. 1993-09-25 01:52:59 +00:00
jtc 80f43f5e44 Provide prototype for POSIX.2 function confstr(). 1993-09-21 21:53:31 +00:00
jtc d229d39c12 Add prototypes for getdomainname() and setdomainname(); the man page
instructs the user to include unistd.h, but it didn't provide a
declaration.
1993-09-10 01:07:39 +00:00
jtc c747426b9b Add __dead qualifier to _exit(), as it never returns. 1993-08-06 21:13:32 +00:00