Commit Graph

160 Commits

Author SHA1 Message Date
thorpej 9377ba2c38 Linux-compatible clone(2) system call, lifted from the Linux
compatibility module.  Based on patches from Bang Jun-Young <bjy@mogua.org>.
2001-07-01 18:06:11 +00:00
kleink c73bcbb0f8 Slight indentation nit. 2001-04-10 11:03:56 +00:00
thorpej 8740614bad getpid(2), our first MP-safe syscall! 2001-01-27 07:47:26 +00:00
nathanw d75edd2077 Reserve system call slots for getcontext, setcontext, LWPs, and
scheduler activations.
2001-01-08 18:25:35 +00:00
jdolecek fbc7e223d7 utrace(2): rename 'id' parameter to 'label' 2001-01-05 21:42:08 +00:00
jdolecek a80dee65df add utrace(2) - this syscall allows to add user ktrace entries
idea from FreeBSD, but added argument (const char *id) so that it's possible
to differentiate between entries from different sources
2000-12-28 11:10:15 +00:00
mycroft 02d8d5f9bf Define 3 new functions:
* sys_getpid_with_ppid()
* sys_getuid_with_euid()
* sys_getgid_with_egid()
that do the retval[1] hack.  Use them when COMPAT_43 is defined.
2000-12-09 07:04:47 +00:00
mycroft 9682cf0b09 Add the %% separators. 2000-12-09 05:27:28 +00:00
bjh21 a9397f5bfc Changes to syscalls.master to exclude ntp_adjtime(2) entirely if NTP is not
defined.  Changes to other files will follow in a moment.
2000-08-07 17:59:33 +00:00
minoura f6051edef5 Add native issetugid() call.
Implementation from compat/freebsd.
2000-04-21 16:15:39 +00:00
mrg a6f7a7855f implement lchflags(2), which does the chflags(2) dance without following
symlinks, and thus can operate on symlinks.  remove a bogus comment in
chflags(1) that claims symlinks do not have file flags.

XXX: todo -- make chflags(1) use lchflags(2) when given the right options.
2000-04-17 14:31:21 +00:00
christos 3cbe025990 __semctl13 -> ____semctl13 because this now is not called directly.
The fourth argument to it is a pointer to union semun not union semun,
because passing structs and unions to syscalls cannot be handled portably.
2000-01-31 15:12:30 +00:00
mycroft db70ed30f4 Use proper varargs format for __semctl13. 2000-01-23 01:01:30 +00:00
thorpej dc8ecaa15b Overhaul of the SVID IPC facilities, primarily to use the types specified
by the Single UNIX Specification version 2, rather than the SVR2-derived
types.  While I was here, I did a namespace sweep to expose the constants
and strucutures, and structure members described by SUSv2; documentation
updates coming shortly.

Fixes kern/8158.
1999-08-25 05:05:48 +00:00
thorpej bee019244f Remove two lines that were apparently added by accident. 1999-07-12 23:01:27 +00:00
kleink e79a283e47 XSH5: change function signature to `void *sbrk(intptr_t)'. 1999-07-12 21:55:19 +00:00
wrstuden d55b282c54 Add fhopen, fhstat, fhstatfs. 1999-06-29 22:15:31 +00:00
thorpej 0cec533f77 Add mlockall at #242 and munlockall at #243. 1999-06-15 23:28:16 +00:00
christos 3f8f92f2b4 Add EXCL keyword as described in tech_kern, and fix comments. Make the
vtrace syscall UNIMPL because it is.
1999-06-09 04:25:30 +00:00
thorpej 8b35c542b5 mincore: caddr_t -> void * 1999-06-08 03:07:39 +00:00
kleink 38c7f65f0c Sync __getlogin()'s namelen argument with the libc-internal declaration
(u_int vs. size_t).
1999-03-28 17:29:52 +00:00
sommerfe 095cd96cd5 Change namei cache to record vnode->(parent,name) entries (for directories).
Add kernel implementation of getcwd() which uses this cache, falling
back to reading the filesystem on a cache miss.
Along for the ride: add new VOP_FSYNC flag FSYNC_RECLAIM indicating
that a reclaim is being done, so only a "shallow" fsync is needed.
1999-03-22 17:01:55 +00:00
kleink dfffb2f357 * Due to addition and use of socklen_t, make the socket option and address
arguments passed to accept(), bind(), connect(), getpeername(), getsockname(),
getsockopt(), recvfrom(), sendto() and sendmsg() unsigned, which also elimiates
a few casts.
* Reflect the (now) signedness of msg_iovlen, which necessiates the addition
of a few casts.
1999-02-10 18:02:28 +00:00
christos bee9dafdf5 defopt COMPAT_43 1998-12-10 15:07:01 +00:00
kleink 5eb7ae9656 getpgid(2) returns a value of type pid_t. 1998-11-26 16:07:05 +00:00
tron 39876df951 Defopt SYSVMSG, SYSVSEM and SYSVSHM. 1998-10-19 22:14:54 +00:00
mycroft 3f2c7263b1 Fix thinko in previous. 1998-09-12 10:48:27 +00:00
mycroft 89ea1fcbdd Version sys_sigreturn, to avoid breaking programs that use it explicitly. 1998-09-12 00:47:12 +00:00
mycroft fb526e055c Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
  versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
  sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
  sys_sigpending() and sys_sigsuspend() into separate functions, and call them
  from all the emulations rather than hard-coding everything.  (Avoids uses
  the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
  pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
  bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
  in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified.  Other ports and
emulations need to be updated.
1998-09-11 12:50:05 +00:00
jonathan d275e56dee * defopt COMPAT_{09,10,11,12,13} and COMPAT_NOMID.
TODO: revisit interaction between native compat and emul compat usage.
1998-07-05 08:49:30 +00:00
thorpej d4e618b3a5 Argh, pad the off_t args in pread/pwrite/preadv/pwritev. System call
numbers don't change since the window of brokenness was so small (1 day).
1998-07-02 01:23:33 +00:00
thorpej f0dda0d383 Add positional read and write system calls:
- pread() (#173) and pwrite() (#174), which are defined by XPG4.2.  System
  call numbers match Solaris.
- preadv() (#289) and pwritev() (#290), which are the positional cousins
  of readv() and writev(), but not defined by any standard.
1998-06-30 19:33:11 +00:00
thorpej d87e6c2b0e defopt NFSSERVER 1998-06-25 22:16:01 +00:00
thorpej d6289815b4 defopt KTRACE 1998-06-25 21:15:35 +00:00
kleink e9d6f5e996 Per IEEE Std 1003.1b-1993, implement the fdatasync() system call which is
identical to fsync() with the expecption of not being required to synchronize
file status information.
1998-06-05 20:31:36 +00:00
kleink bb7e6a0bdd Per XSH98, const'ify the `addr' arguments to mlock() and munlock(). 1998-05-30 22:21:03 +00:00
kleink e3611654cd Several SYSV IPC prototype changes. 1998-05-07 17:08:42 +00:00
christos 02cecf686a New fktrace syscall from Darren Reed [with fixes from me] 1998-05-02 18:33:19 +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
perry 56c01cbd82 change second parm of sysarch() from char * to void * 1998-02-25 21:24:56 +00:00
thorpej 58fff16650 Include the NFS and LFS option headers. 1998-02-19 00:52:14 +00:00
kleink 3404e6deb3 Implement __posix_chown(), __posix_fchown() and __posix_lchown(). Also,
rename posix_rename() to __posix_rename() to follow this convention.
1998-02-14 20:01:05 +00:00
thorpej da187f7f6d Reserve syscalls 283, 284, and 285 for 3 up-coming POSIX systems calls,
per kleink.  Add XPG4.2's getsid(2) at #286.
1998-02-14 00:39:33 +00:00
thorpej d36ffe9822 Add __vfork14() system call at #282. 1998-01-04 03:45:21 +00:00
kleink 5d7a8f4a16 Modify the recent sigaltstack() interface change to use the __RENAME() scheme;
add __sigaltstack14().
1997-11-29 18:38:20 +00:00
kleink a255f23ee3 In XPG4.2, the ss_size member of type stack_t (struct sigaltstack) is specified
to be of type size_t; since this imposes an interface change on the Alpha
(sizeof(int) != sizeof(size_t)), allocate a new system call number and make
the previous version a compatibility system call.
1997-11-25 19:32:15 +00:00
thorpej 97d2a58201 Fix slight argument bogosity with getgroups(), setgroups(), select(),
and swapctl().  For the former three, they use an 'int' in their user-land
prototype which was a 'u_int' in the kernel, which screwed up automatic
generation/checking of lint syscall stubs.  For the latter, the user-land
prototype uses a "const char *", but the syscall just used "char *".

From Chris Demetriou <cgd@pa.dec.com>.
1997-11-04 21:24:14 +00:00
thorpej 14cd99880c Fix the shared library versioning snafu caused by the recent changes
to the stat(2) family and msync(2).  This uses a primitive function
versioning scheme.

This reverts the libc shared library major version from 13 to 12, and
adds a few new interfaces to bring us to libc version 12.20.

From Frank van der Linden <fvdl@NetBSD.ORG>.
1997-10-20 22:05:06 +00:00
mycroft 606346112c umask(2) accepts and returns a mode_t. 1997-10-19 03:25:55 +00:00
christos 3130feba6d Fixed missed const char * in lstat (thanks enami) and changed caddr_t -> void *
in the mman family.
1997-10-18 16:35:25 +00:00
christos 9b763cbe70 change char *path to const char *path
change int to mode_t's and to dev_t's as appropriate
add new new stat syscem calls and make the old ones compatibility.
1997-10-16 23:41:31 +00:00
mycroft 5570f69778 Adjust u_int arguments of some system calls to int, to match user-level
prototypes.
1997-10-15 17:27:46 +00:00
mycroft 2587de6af9 Adjust u_int arguments of some system calls to int, to match user-level
prototypes.
1997-10-15 17:03:52 +00:00
fvdl da29e54dfb Add getdents(). Rename getdirentries to compat_12_getdirentries. 1997-10-10 02:03:47 +00:00
enami 9ccb5d2e4d Add system call lchmod (#274), lchown (#275) and lutimes (#276). 1997-10-03 15:06:18 +00:00
veego 33a2f6fd68 Ups. 1997-09-09 08:05:35 +00:00
veego b6cefe68ad Move sys_minherit from 250 to 273 and add a comment why 240-269 are
reserved.
1997-09-09 08:04:11 +00:00
chuck bca26d18f9 add sys_minherit (from openbsd) 1997-09-08 18:03:32 +00:00
mrg 9cee42ea7c swapon back to compat_12 syscall.. 1997-06-12 22:05:37 +00:00
mrg abe622f20b for now, leave swapon(8) in place. 1997-06-12 21:41:56 +00:00
mrg c59ed4fd4d add sys_swapctl(), and deprecate, with COMPAT_12, sys_swapon 1997-06-12 14:23:46 +00:00
kleink d3aadd8976 Add posix_rename() syscall. 1997-05-18 19:56:48 +00:00
jtc c9b0c57620 Add POSIX.1b nanosleep(). 1997-04-16 14:41:28 +00:00
thorpej 55ee7ceeb8 NFSCLIENT -> NFS 1997-01-31 02:34:23 +00:00
cgd acad90d846 * (slight) general cleanup
* change in-kernel syscall prototypes to match user-land prototypes in
  the following ways:
    + add 'const' where appropriate.
    + make the following "safe" type changes where appropriate:
	caddr_t -> struct msghdr *
	caddr_t -> struct sockaddr *
	caddr_t -> void *
	char * -> void *
	int -> uid_t (safe because uid_t not used as index/count)
	int -> gid_t (safe because gid_t not used as index/count)
	u_int -> size_t
    + change "int" to "u_long" in flags arguments to chflags() and
      fchflags().  This is safe because the arguments are used as
      flag bits and there's nothing that would cause the top bit
      of the int to be set yet, and because the user-land definitions
      already specified u_long, so a u_long's worth of argument was
      already being passed in.
1996-12-22 08:04:06 +00:00
cgd 997ec138ad change ntp_gettime's struct ntptimeval *'s name to match kern_ntptime.c 1996-12-22 07:47:43 +00:00
cgd c99936a735 * fix return types. previously, most things returned 'int.' which was
wrong for a bunch of functions:
	void:		sys_exit, sys_sync
	ssize_t:	sys_read, sys_write, sys_recvmsg, sys_sendmsg,
			sys_recvfrom, sys_readv, sys_writev, sys_sendto
	long:		sys_pathconf, sys_fpathconf
	void *:		sys_shmat

* Note that sys_open, sys_ioctl, and sys_fcntl are defined such that their
  last argument is optional.

These changes should not have any real effect, because right now this
information is not actually used for anything.
1996-12-22 07:00:57 +00:00
cgd 747448fc3e mark syscall() and __syscall() as INDIR syscalls 1996-12-22 06:46:50 +00:00
cgd e9a07759c9 ntp_gettime()'s argument is a struct ntptimeval *, not a struct timex * 1996-12-22 06:23:38 +00:00
thorpej 49989d779a Back out this piece of revision 1.38:
>- Optional systems calls are "UNIMPL" if the support is not being
>  compiled into the kernel.

It had implications that didn't occur to me at the time.  *sigh*
1996-12-06 20:05:31 +00:00
thorpej f85bef61f1 Include sys_getfh() if NFSSERVER || NFSCLIENT. 1996-12-03 00:28:31 +00:00
jtc d22cdecb45 Add clock_gettime, clock_settime, and clock_getres 1996-11-15 22:44:25 +00:00
thorpej 9d9479eb2f Make ntp_gettime() and ntp_adjtime() like other system calls:
- The functions that implement them and the argument names are
  prepended with "sys_".
- Optional systems calls are "UNIMPL" if the support is not being
  compiled into the kernel.
1996-11-14 04:51:09 +00:00
jtc 16fe807b60 renamed sys_getlogin to sys___getlogin. required by libc namespace conventions 1996-09-19 04:52:12 +00:00
mycroft cdd2b02b50 Modify poll(2) prototype. 1996-09-07 14:16:42 +00:00
mycroft 2bc736661a Implement poll(2). 1996-09-07 12:40:22 +00:00
mrg 5abbf990f3 Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models.  It is currently silently ignored on all other
hardware now, however.  The MD function "boot()" has been changed to
also take a char *.
1996-08-09 10:30:23 +00:00
mycroft 351bdbd445 Implement setre[ug]id() compatibly with 4.3BSD, SunOS, and Linux. 1996-06-23 11:04:11 +00:00
mycroft af747826c6 Add futimes(), at position 206. 1996-04-23 10:24:21 +00:00
jonathan e7ef034c05 Add NTP kernel precision timekeeping from Dave Mill's xntp distribution
and the "kernel.tar.Z" distribution on louie.udel.edu, which is older than
xntp 3.4y or 3.5a, but contains newer kernel source fragments.

This commit adds support for a new kernel configuration option, NTP.
If NTP is selected, then the system clock should be run at "HZ", which
must be defined at compile time to be one value from:
  60, 64, 100, 128, 256, 512, 1024.

Powers of 2 are ideal; 60 and 100 are supported but are marginally less
accurate.

If NTP is not configured, there should be no change in behavior relative
to pre-NTP kernels.

These changes have been tested extensively with xntpd 3.4y on a decstation;
almost identical kernel mods work on an i386.  No pulse-per-second (PPS)
line discipline support is included, due to unavailability of hardware
to test it.

With this in-kernel PLL support for NetBSD, both xntp 3.4y and xntp
3.5a user-level code need minor changes. xntp's prototype for
syscall() is  correct for FreeBSD, but not for NetBSD.
1996-02-27 04:20:30 +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 44a38d8470 Add aliases for all compat functions. 1995-10-10 01:32:53 +00:00
mycroft 245f292fed Prefix names of system call implementation functions with `sys_'. 1995-10-07 06:25:19 +00:00
mycroft 57e6889435 Make memory map syscalls consistently use size_t. 1995-03-09 17:28:28 +00:00
cgd dfa90d1c7f obsolete resuba, per ragge. 1995-01-06 00:08:17 +00:00
mycroft fcef736c87 Add undelete syscall, per CSRG. 1994-12-14 16:29:54 +00:00
mycroft 452508f874 Fix typos. 1994-10-21 00:14:36 +00:00
cgd 6b86130410 update for new syscall args description mechanism 1994-10-20 04:22:35 +00:00
cgd cf92afd66e New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:29:24 +00:00
cgd eea64debf1 make getdtablesize COMPAT_43; should be COMPAT_44 or _09, but that has probs 1994-06-14 05:18:03 +00:00
mycroft 699bbb84b6 Update to 4.4-Lite fs code. 1994-06-08 11:28:29 +00:00
cgd e37f8e4023 add support for 'NCOMPAT' to deal with NetBSD compat defines 1994-05-17 00:00:46 +00:00
cgd 2046e01e40 do the syscall shuffle. this is most of the rest 1994-05-07 00:39:06 +00:00
cgd 4d3fb006eb kill damned off_t weirdness, also upgrade get- and setrlimit. 1994-05-01 05:02:24 +00:00
cgd 6029e550f1 kill 'aliases' 1994-04-29 04:29:14 +00:00
cgd 551e92c16a start to phase out temp. off_t syscalls 1994-04-16 23:19:06 +00:00
cgd 2396958784 kill two LIBCOMPATs 1994-04-07 00:15:29 +00:00
cgd 8abbe136e3 some temporary syscall shuffling 1994-04-02 08:03:17 +00:00
cgd 4a28c23c2f do the syscall shuffle 1994-03-27 08:34:59 +00:00
cgd ba8c3b1ce4 move LKM syscalls to 210 -> 219, and fix comment 1994-03-08 23:57:00 +00:00