Commit Graph

160 Commits

Author SHA1 Message Date
christos
152eb5a9c3 according to the manual, the last argument of quotactl(2) is a void *,
not a caddr_t.
2006-10-17 15:06:18 +00:00
matt
30183e299f Don't conditionalize *sys_ptrace. The lack of sys_ptrace will be dealt
with differently.
2006-09-01 20:58:18 +00:00
matt
0cf3f9db4e Add || defined(_KERNEL) to ptrace entry (like ktrace). 2006-08-30 11:34:26 +00:00
matt
9e0ec4816e Make PTRACE and COREDUMP optional. Make the default (status quo) by putting
them in conf/std.
2006-08-29 23:34:48 +00:00
martin
f956f13e21 Step 1 to make filehandles completely opaque to userland 2006-07-31 16:32:51 +00:00
martin
a3b5baed42 Fix alignement problems for fhandle_t, exposed by gcc4.1.
While touching all vptofh/fhtovp functions, get rid of VFS_MAXFIDSIZ,
version the getfh(2) syscall and explicitly pass the size available in
the filehandle from userland.

Discussed on tech-kern, with lots of help from yamt (thanks!).
2006-07-13 12:00:24 +00:00
mrg
e2eb31d3a3 version the socket(2) syscall. for compat30 socket, we use
EPROTONOSUPPORT instead of EAFNOSUPPORT.

from pavel@ with a little bit of clean up from myself.

XXX: netbsd32 (and perhaps other emulations) should be able
XXX: to call the standard socket calls for this i think, but
XXX: revisit this at another time.
2006-06-26 21:23:56 +00:00
drochner
42a3bd3098 Extend "struct ntptimeval" for the needs of "timecounters".
Allocate a new syscall for ntp_gettime() and set up COMPAT_30 for
the old one.
2006-05-29 09:57:54 +00:00
christos
9ec9aed92e fhstat needs to be versioned too (for ino_t). Pointed out by Izumi Tsutsui 2006-05-04 17:48:56 +00:00
drochner
e4c5c3aea6 constify the __sysctl() kernel side 2006-02-24 19:20:20 +00:00
yamt
221616873d merge yamt-readahead branch. 2005-11-29 22:52:02 +00:00
christos
65a3ca6215 some of the extattr syscalls return ssize_t not int. 2005-09-26 03:02:19 +00:00
christos
50f8955b6e 64 bit inode changes. 2005-08-19 02:04:03 +00:00
thorpej
ccbebfaaf1 Add Linux-compatible {,fl}{get,set,list}xattr() system call interface
to the VFS extended attribute subsystem.
2005-07-10 22:04:20 +00:00
christos
44285e060d Argument for swapctl cannot be const, since it gets loaded with swap
statistics.
2005-05-29 21:07:49 +00:00
matt
124745835a Add pselect and pollts 2005-02-25 19:53:56 +00:00
matt
16cf76fdc3 Add placeholders for sys_pselect and sys_pollts 2005-02-19 22:15:51 +00:00
thorpej
1c95472d01 Add the system call and VFS infrastructure for file system extended
attributes.

From FreeBSD.
2005-01-02 16:08:28 +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
kleink
681b62c2ce POSIX-2001: Add restrict keywords to gettimeofday(2) and setitimer(2);
further deprecate struct timezone usage by changing `tzp' argument to
gettimeofday() to void *; align utimes(2) declaration by changing `times`
argument from struct timeval * to struct timeval[2].  From Murray
Armfield in PR standards/25331.

In due curse, reflect these changes in futimes(2), lutimes(2), and
settimeofday(2).
2004-04-27 01:12:44 +00:00
kleink
3e7f30c118 POSIX-2001: Change the `who' argument to [gs]etpriority(2) from int
to id_t.  Partially addressing PR standards/25216 from Murray Armfield.
2004-04-25 22:18:08 +00:00
christos
6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
drochner
9fd8e8983b all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 15:18:54 +00:00
cl
919b9e33c4 g/c sys_sa_unblockyield which has been unused since 2004/01/02 2004-03-14 00:45:21 +00:00
tsarna
72489e1ea0 uuidgen(2) syscall. Originally from FreeBSD, ported by John Franklin in
PR#23470, with minor updates by me. This is only the syscall support
from that PR, for now.

Changes: port over fix from FreeBSD for multicast address generation.
Changed bcopy to memcpy.  For now, #ifdef notyet the portions of
kern_uuid.c that are meant to be used by (currently nonexistent) other
things in the kernel.  Added syscall to COMPAT_FREEBSD as well, though
that's currently not useful, as any program new enough to use this call
also uses other syscalls we don't (yet) emulate.
2004-01-29 02:00:02 +00:00
cl
e7045955c7 kernel part of no-syscall upcall stack return: libpthread registers
an offset between ss_sp and struct sa_stackinfo_t (located in struct
__pthread_st) when calling sa_register.  The kernel increments the
sast_gen counter in struct sastack when an upcall stack is used.
libpthread increments the sasi_stackgen counter in struct
sa_stackinfo_t when an upcall stack is freed.  The kernel compares the
two counters to decide if a stack is free or in use.

- add struct sa_stackinfo_t with sasi_stackgen to count stack use in
  userland
- add sast_gen to struct sastack to count stack use in kernel
- add SA_FLAG_STACKINFO to enable the stackinfo_offset argument in the
  sa_register syscall
- add sa_stackinfo_offset to struct sadata for offset between ss_sp
  and struct sa_stackinfo_t
- add ssize_t stackinfo_offset argument to sa_register, initialize
  struct sadata's sa_stackinfo_offset from it if SA_FLAG_STACKINFO is
  set
- add sa_getstack, sa_getstack0, sa_stackused and sa_setstackfree
  functions to find/use/free upcall stacks and use these where
  appropriate
- don't record stack for upcall in sa_upcall0
- pass sau to sa_switchcall instead of l2 (l2 = curlwp in sa_switchcall)
- add sa_vp_blocker to struct sadata to pass recently blocked lwp to
  sa_switchcall
- delay finding a stack for blocked upcalls to sa_switchcall
- add sa_stacknext to struct sadata pointing to next most likely free
  upcall stack; also g/c sa_stackslist in struct sadata and sast_list
  in struct sastack
- add L_SA_WOKEN flag: LWP is on sa_woken queue
- add L_SA_RECYCLE flag: LWP should be recycled in sa_setwoken
- replace l_upcallstack with L_SA_WOKEN/L_SA_RECYCLE/L_SA_BLOCKING
  flags
- g/c now unused sast_blocker in struct sastack
- make sa_switchcall, sa_upcall0 and sa_upcall_getstate static in
  kern_sa.c
- call sa_upcall_userret only once in userret
- split sa_makeupcalls out of sa_upcall_userret and use to process
  the sa_upcalls queue
- on process exit: mark LWPs sleeping in saunblock interruptible; also
  there are no LWPs sleeping on l->l_upcallstack anymore; also clear
  sa_wokenq_head to prevent unblocked upcalls

additional changes:
- cleanup timerupcall sa_vp == curlwp check
- add check in sa_yield if we didn't block on our way here and we
  wouldn't any longer be the LWP on the VP
- invalidate sa_vp_ofaultaddr after resolving pagefault
2004-01-02 18:52:17 +00:00
thorpej
857f24339f Kernel portion of the fsync_range(2) system call. Written by Bill
Studenmund, and contributed by Wasabi Systems, Inc.
2003-11-15 01:19:38 +00:00
christos
4420def0dc #ifdef _LIBC the semid_t syscalls since we don't define semid_t in userland
except in the libc case.
XXX: Should we define __semid_t instead and make those visible from userland
again? Only ktrace and syscall() get affected.
2003-09-30 20:36:10 +00:00
matt
ebb8ea4c89 Constify __sigaction_sigtramp argument 'void * tramp'. 2003-09-26 23:08:24 +00:00
christos
b601ca6ba8 __sigaction14 should have been COMPAT_16 a while ago. GC it now. 2003-09-23 14:34:07 +00:00
cl
c08e54b26b fix SA/pthread pagefault failure:
- prevent BLOCKED upcalls on double page faults and during upcalls
- make libpthread handle blocked threads which hold locks
- prevent UNBLOCKED upcalls from overtaking their BLOCKED upcall
this adds a new syscall sa_unblockyield
see also http://mail-index.netbsd.org/tech-kern/2003/09/15/0020.html
2003-09-16 13:46:24 +00:00
christos
883b4b0369 we don't need sigreturn and sigcode glue if we are not compat_16 anymore. 2003-09-10 16:43:34 +00:00
christos
1623253ed2 _lwp_setprivate returns void 2003-03-18 18:08:49 +00:00
jdolecek
c58bfd1c36 add __sigtimedwait(2) - wait for specified set of signals, with optional
timeout
the semantics of 'timeout' parameter differ to POSIX for the syscall
(not const, may be modified by kernel if interrupted from the wait) -
libc will provide appropriate wrapper

since sigwaitinfo(2) will be implemented as wrapper around sigtimedwait()
too, remove it's reserved slot and move sigqueue slot 'up', freeing
slot #246
2003-02-15 20:54:38 +00:00
thorpej
237ebf04da Reserve slots for the p1003.1b scheduler system calls. 2003-01-24 01:27:21 +00:00
thorpej
c8c6d5ea40 Reserve slots for p1003.1b message queue calls. 2003-01-24 01:23:27 +00:00
thorpej
9331f2b780 Allocate a slot for _ksem_timedwait(), although it is not currently
implemented.
2003-01-24 01:17:53 +00:00
thorpej
5db6496bbc Allow the _ksem_*() syscalls to be properly seen by ktruss/kdump. 2003-01-23 23:29:46 +00:00
christos
1dbdd7cc6d sys_ksem -> sys__ksem 2003-01-20 20:24:21 +00:00
christos
4a037b0375 actually, remove ksem.h 2003-01-20 20:04:28 +00:00
christos
f64e9a84b1 semaphore.h -> ksem.h 2003-01-20 20:03:38 +00:00
christos
1df6f4ff40 add support for p1003.1b semaphores. From FreeBSD 2003-01-20 20:02:56 +00:00
thorpej
e0d8d366df Merge the nathanw_sa branch. 2003-01-18 10:06:22 +00:00
thorpej
39e4cd68c4 Reserve syscall slots for sigwaitinfo(2), sigtimedwait(2), and
sigqueue(2).
2002-12-19 23:51:00 +00:00
jdolecek
e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
jdolecek
281be34ad1 claim syscall slots for kqueue(2) and kevent(2) 2002-09-04 07:45:41 +00:00
gmcgarry
5bcbbd40bf MI kernel support for user-level Restartable Atomic Sequences (RAS). 2002-08-28 07:16:33 +00:00
briggs
a67324a44a New syscalls: sys_pmc_get_info and sys_pmc_control. 2002-08-07 04:52:53 +00:00
thorpej
011d4d5f44 Add kernel support for having userland provide the signal trampoline:
* struct sigacts gets a new sigact_sigdesc structure, which has the
  sigaction and the trampoline/version.  Version 0 means "legacy kernel
  provided trampoline".  Other versions are coordinated with machine-
  dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
  the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
  trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions.  Instead,
  sendsig() looks up the handler by peeking in the sigacts for the
  process getting the signal (since it has to look in there for the
  trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
  its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later.  Kernel
version not bumped; we will ride the 1.6C bump made recently.
2002-07-04 23:32:02 +00:00
eeh
9bd29db83b Use #if defined(_LP64) to determine if we're generating 64-bit binaries,
not #if defined(alpha).
2002-05-03 00:20:56 +00:00