Commit Graph

4213 Commits

Author SHA1 Message Date
tnn
f85d89c5de v_interlock is a kmutex_t now, simple_lock() -> mutex_enter(). 2008-03-07 00:03:39 +00:00
elad
2a9368a7e7 In linux_sys_sched_getparam(), get the native policy too, so that we have
a better chance at properly converting the priority.

Noted by & okay yamt@.
2008-02-29 14:29:06 +00:00
dogcow
15debf8a40 Add some of those pesky semicolons, and correct number of args. 2008-02-29 08:41:51 +00:00
elad
67470a76a1 Factor out the guts of get/setparam so it can be used from the compat code.
Make the FreeBSD and Linux compat code convert the parameters to their
native representation and call the native routines.

Remove KAUTH_PROCESS_SCHEDULER_GET/SET.

Update documentation and examples.

XXX: For now, only the Linux compat code does the priority conversion
XXX: right.

Linux priority conversion code from yamt@, thanks!

Okay yamt@.
2008-02-28 16:09:18 +00:00
martin
777a451a3d Remove old posix_fadvise compat code 2008-02-24 15:02:15 +00:00
martin
c84d2ae11b Remove compat code for posix_fadvise 2008-02-24 12:54:15 +00:00
martin
93cbe0f210 Regen (old posix_fadvise ignored) 2008-02-24 12:53:47 +00:00
martin
a8ed8bb731 Desupport compatibility for the old posix_fadvise syscall per yamt's
request and just ignore it.
2008-02-24 12:52:54 +00:00
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