Commit Graph

4205 Commits

Author SHA1 Message Date
njoly
ac6668f329 Regen for mlock/munlock syscalls 2008-02-20 21:51:39 +00:00
njoly
e578f6862b Add mlock/munlock syscalls 2008-02-20 21:49:56 +00:00
njoly
6d3975648f Regen for pread/pwrite fixes. 2008-02-17 21:50:36 +00:00
njoly
fc9f8f74de pread/pwrite fixes: use SCARG_P32 to access pointers, and update
syscalls definitions.
2008-02-17 21:49:17 +00:00
elad
e99760e7e4 Fold KAUTH_REQ_PROCESS_SCHEDULER_* to KAUTH_PROCESS_SCHEDULER_*. In other
words, don't pass an action and a request, and just use a single action to
indicate what is the operation in question.

This is the first step in fixing PR/37986, which calls for policy/priority
checking in the secmodel code. Right now we're lacking room for another
parameter required to make a decision, and this change makes room for such.
2008-02-16 16:39:34 +00:00
matt
14f857fff2 Update to c99. 2008-02-13 17:41:09 +00:00
joerg
e69482d49d Introduce device_find_by_xname and device_find_by_driver_unit to replace
alldevs iterations all over src.

Patch discussed with and improved on suggestioned from cube@.
2008-02-12 17:30:57 +00:00
he
301a1d2d21 Need to include <sys/fstypes.h> before <sys/vfs_syscalls.h> to get
fhandle_t defined, which is used in a function prototype in the latter.
2008-02-12 10:59:57 +00:00
ad
d7f6ec471c Don't lock the socket to set/clear FNONBLOCK. Just set it atomically. 2008-02-06 21:57:53 +00:00
dsl
c060191386 Regen for merging fcntl() and fcntl64(). 2008-02-04 22:24:33 +00:00
dsl
174ee4c867 Use the same function to implement linux32_sys_fcntl() and linux_sys_fcntl64().
A rather excessive amount of 'appending 64' to names seems to have happened
when linux won support for files > 4G.
technically the linux32_sys_fcntl() function should error the 64bit file
locking requests - but life is too short.
2008-02-04 22:23:43 +00:00
dsl
9d820ef01c Regen for pread and pwrite 2008-02-02 22:57:49 +00:00
dsl
543ce18e89 Impletemt pread() and pwrite(). 2008-02-02 22:57:05 +00:00
dsl
22774d7c0d Fix the linux32 emulations of fcntl() locking.
The 64bit linux emulation versions can't be used because the lock structure
alignment and field sizes all differ.
Since there need to be 4 different versions of the linux struct flock, and
amd64 kernel needs 3 of them compiled in, rather than replicating the same
code block twice more, move the body of the code into a few #defines
that can be expanded with the correct types in the linux[32]_sys_fcntl[64]()
functions.
Should fix problems running progams like skype running under linux32
emulation on amd64.
2008-02-02 21:54:01 +00:00
dsl
7e5ac7072d Extract the fcntl64() suppoort from linux_file64.c into linux_fcntl64.c
Unravel some of the knots that caused linux_file64.c to be compiled twice
for an amd64 kernel (once for linux and once for linux32) with different
parts being skipped each time.
2008-02-02 19:37:52 +00:00
dsl
4e55f805dd Fix build 2008-02-02 15:17:06 +00:00
dsl
020f5fa28f Use the netbsd32_[u]int64 type for all 64bit items to ensure we have the
correct alignment/padding rules.
Removed the now-unnecessary #pragma packed for amd64.
Should fix the alignment of 'struct netbsd32_kevent' on non-amd64.
2008-02-02 14:34:56 +00:00
dsl
0df418f9cb Change u_intxx_t to uintxx_t and uint to unsigined int etc.
Fix indentation.
2008-02-02 13:58:18 +00:00
ad
25153c3ec9 PR kern/37706 (forced unmount of file systems is unsafe):
- Do reference counting for 'struct mount'. Each vnode associated with a
  mount takes a reference, and in turn the mount takes a reference to the
  vfsops.
- Now that mounts are reference counted, replace the overcomplicated mount
  locking inherited from 4.4BSD with a recursable rwlock.
2008-01-30 11:46:59 +00:00
rafal
77f8afb936 Adapt to renamelock_{enter, exit} addition to struct vfsops. 2008-01-29 04:06:46 +00:00
njoly
4eecf433ec Make shmctl + {IPC,SHM}_STAT work an amd64, by forcing use of IPC_64.
Following the Linux kernel behaviour.
2008-01-28 14:31:35 +00:00
njoly
ff7363568f Update struct linux_shmid64_ds for 64bits archs.
- shm_segsz should be of type size_t, not int.
- Disable padding fields used on 32bits archs.
2008-01-28 14:14:48 +00:00
njoly
29158b16e8 shmctl fixes.
- SHM_STAT take an index as input, and return the corresponding shmid.
- IPC_INFO and SHM_INFO returns the highest used index.
- SHM_INFO expected the total used pages (not bytes) in shm_tot field
  of struct shm_info.
2008-01-28 14:05:32 +00:00
martin
e68297ad60 wrong argument type 2008-01-28 00:19:28 +00:00
martin
98e544d2b4 Regen (posix_fadvise versionend) 2008-01-27 20:14:12 +00:00
martin
c9146bcc25 Catch up with versioning of posix_fadvise 2008-01-27 20:13:07 +00:00
dsl
cb0033a159 Call do_posix_fadvise() in netbsd32_posix_fadvise() 2008-01-27 19:51:40 +00:00
martin
2e87d89112 Implement new version of posix_fadvise as a stub callinig the real
worker function, and compatibility stub doing the same with old argument
sturcture.
2008-01-27 16:16:50 +00:00
dsl
769c734483 Remove some dubious casting of the address of integer variables that
can only be 'not invalid' if the sizes match - when it is unnecessary.
2008-01-26 21:01:23 +00:00
dsl
d84d2af8e2 Split the return value of sys_lseek() into two 32 bit halves for retval[0/1]
in a manner that is endianness independant.
Should mean the amd64 will return correct offsets > 2^32 (sparc64 had a
special define).
Any new netbsd32 ports should work regardless of the endianness.
2008-01-26 20:57:46 +00:00
tsutsui
ae2fa185c0 VOP_LEASE is gone. 2008-01-26 15:48:11 +00:00
tsutsui
e44e8e02b0 Fix fallout from v_specinfo removal. 2008-01-26 15:37:35 +00:00
dsl
a94c98311a Don't try to bound the return value for pread/pwrite/pathconf by casting
an 'ssize_t' or 'long' variable to 'register_t'.
If the sizes were different it would either overwrite stack or return
uninitialised stack.  On big-endian systems things would be worse!
2008-01-26 09:07:01 +00:00
dsl
fe0f1a7e5d regen 2008-01-26 08:44:48 +00:00
dsl
be09b9791a Add a wrapper for posix_fadvise() 2008-01-26 08:35:51 +00:00
ad
1997a1e1f4 Remove VOP_LEASE. Discussed on tech-kern. 2008-01-25 14:32:11 +00:00
elad
365cb5272e Use KAUTH_ARG(), from hannken@ - thanks! 2008-01-23 19:06:59 +00:00
elad
b97e1dc060 Use SCARG() to get pid, we don't have it as a local.
Spotted by hannken@, thanks!
2008-01-23 17:55:40 +00:00
elad
c27d5f30b6 Tons of process scope changes.
- Add a KAUTH_PROCESS_SCHEDULER action, to handle scheduler related
    requests, and add specific requests for set/get scheduler policy and
    set/get scheduler parameters.

  - Add a KAUTH_PROCESS_KEVENT_FILTER action, to handle kevent(2) related
    requests.

  - Add a KAUTH_DEVICE_TTY_STI action to handle requests to TIOCSTI.

  - Add requests for the KAUTH_PROCESS_CANSEE action, indicating what
    process information is being looked at (entry itself, args, env,
    open files).

  - Add requests for the KAUTH_PROCESS_RLIMIT action indicating set/get.

  - Add requests for the KAUTH_PROCESS_CORENAME action indicating set/get.

  - Make bsd44 secmodel code handle the newly added rqeuests appropriately.

All of the above make it possible to issue finer-grained kauth(9) calls in
many places, removing some KAUTH_GENERIC_ISSUSER requests.

  - Remove the "CAN" from KAUTH_PROCESS_CAN{KTRACE,PROCFS,PTRACE,SIGNAL}.

Discussed with christos@ and yamt@.
2008-01-23 15:04:38 +00:00
jmcneill
c0e43ab0d6 Add ossaudio support for COMPAT_LINUX32, with help from mrg. With this
change, audio now works on amd64 with native firefox, nspluginwrapper, and
the 32-bit linux flash binaries.
2008-01-22 01:05:05 +00:00
joerg
3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
dsl
56cba2eaaa Remove stackgap functions externs. 2008-01-20 09:37:58 +00:00
dsl
da6834a7bc Regen for netbsd32_mremap 2008-01-19 22:25:36 +00:00
dsl
e7cd2030cf Add netbsd32 wrapper for sys_mremap(), compiles, and assuming the mmap()
wrapper is ok, it should work!
I presume the kernel knows not to map above 4GB though....
2008-01-19 22:25:12 +00:00
skrll
278f254bbd Spelling in comment. 2008-01-18 09:38:06 +00:00
njoly
f5183fca22 Regen. 2008-01-15 22:40:14 +00:00
njoly
5cec0f492f compat linux (and linux32) uid16 functions cleanup and fixes.
- Move uid16 functions to their own file linux_uid16.c, included by
  needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
  bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
2008-01-15 22:38:34 +00:00
martin
1ae6b7fd19 #ifdef COMPAT_20 the ioctls only available conditionally. Patch from
Geoff Wing.
2008-01-15 09:25:26 +00:00
martin
a5134c7940 Add net80211 ioctls that I apparently ovelooked when grepping for ioctls
that need "struct ifreq" compat treatment.
This makes for example old (like 4.0) wpa_supplicant work with -current
kernels.
2008-01-14 21:38:55 +00:00
tnn
8134e656ee fd_revoke: variable vattr is no longer used. 2008-01-09 20:45:19 +00:00