Commit Graph

344 Commits

Author SHA1 Message Date
dsl 6e1d30d402 Use 'curlwp' here insteald of the 'l' - which isn't passsed as an arg
to the #define, but will always be curlwp.
2011-06-05 09:37:10 +00:00
bouyer d9210c2405 Add a new libquota library, which contains some blocks to build and/or
parse quota plists; as well as a getfsquota() function to retrieve quotas
for a single id from a single filesystem (whatever filesystem this is:
a local quota-enabled fs or NFS). This is build on functions getufsquota()
(for local filesystems with UFS-like quotas) and getnfsquota();
which are also available to userland programs.
move functions from quota2_subr.c to libquota or libprop as appropriate,
and ajust in-tree quota tools.
move some declarations from kernel headers to either sys/quota.h or
quota/quota.h as appropriate. ufs/ufs/quota.h still installed because
it's needed by other installed ufs headers.
ufs/ufs/quota1.h still installed as a quick&dirty way to get a code
using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of
ufs/ufs/quota.h - old code won't compile without this change and this is
on purpose).
Discussed on tech-kern@ and tech-net@ (long thread, but not much about
libquota itself ...)
2011-03-24 17:05:39 +00:00
bouyer 063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
christos af8f930405 PR/44674: Taylor R Campbell: Fix compat copyin and copyout routines which
were obviously broken.
2011-03-04 01:36:56 +00:00
rmind 9b6bd2d968 Remove clause 3 (UCB advertising clause) from the University of Utah
copyright.  Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
2011-02-08 20:20:06 +00:00
matt 4d5d6d9aa5 Add a new AF/PF_ROUTE which is 64-bit clean which makes the routing socket
interface (and its associated sysctls) act identically for both 32 and 64 bit
programs.  The old unclean one remains for backward compatibility.
2011-02-01 01:39:19 +00:00
tsutsui dcd10dc42d Remove includes <sys/mount.h> and <sys/sched.h> added for <sys/syscallargs.h>.
Now they are handled by $sysarghdrextra in sys/kern/syscalls.conf.
2011-01-19 10:21:16 +00:00
pooka 4ded7232b9 Put async i/o compat routines in a separate source module from the
ones related to clock and process management.
2011-01-17 15:57:04 +00:00
dholland 8f6ed30d57 Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
2010-11-19 06:44:33 +00:00
christos 988094ed68 can't map the old and the new SIO calls the way we did before because the
numbers have changed. Instead provide a switch. Keep the old code there,
to handle cases we did not handle in the first switch, but this is a hack
and should be removed.
2010-11-06 17:20:07 +00:00
pooka c99c5d9840 Don't leak kernel stack into userspace. 2010-07-13 15:38:15 +00:00
hannken 1423e65b26 Clean up vnode lock operations pass 2:
VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
2010-06-24 12:58:48 +00:00
drochner 690a7f09c9 -fix internal use of sigwaitinfo(2) by sigwait(3): The former returns
the signal number now, as required by POSIX. The latter should just
 return 0 on success. Fixes a mysql problem reported by Kurt Schreiner.
-document the new behavior of sigwaitinfo and sigtimedwait
-retain non-POSIX behavior for NetBSD-5 binary compatibility -- the fix
 would likely not be polled into the .0-branches, and having 5.0.x and
 5.x behave differently would be confusing. Besides that, it was
 documented in the manpage all the time.
2010-05-30 19:31:39 +00:00
njoly 4f2ea8f3c9 Add a new clock_gettime1() function that holds most of the
clock_gettime syscall code (except for the copyout). Adjust all
corresponding syscalls to make use of it.
2010-04-08 11:51:13 +00:00
njoly 0876f873dd Move most clock_getres syscall code, except for coypout call, to a new
clock_getres1() function which can be used by emulations. Adjust all
clock_getres syscalls to now make of use it.
2010-04-03 17:20:05 +00:00
pooka 934159ae4a Reset sendsig_sigcontext_vec at fini to avoid having it point at
garbage and to allow re-init of the module (if DIAGNOSTIC).
2010-03-05 16:55:56 +00:00
he 7a30544200 When implementing "read directory", when there are too many empty entries
in a row, and we need to try to read the next block, and have passed a
non-NULL cookie pointer to VOP_READDIR, ensure that we free the cookie
buffer before re-doing VOP_READDIR, so that we don't leak memory.
This fix is similar to nfs_serv.c revisions 1.115 + 1.124.

This should fix the long-standing problem observed by e.g. using Linux-
emulated programs to take backup of servers, which is one of the problems
which were reported in PR#42661.

Thanks to pooka@ for the hints for traversing the VOP* layer.
2010-03-03 08:20:38 +00:00
pooka 18c92f1166 fs_union.h is not used here anymore ... diudau 2010-03-02 14:23:39 +00:00
pooka 654415b2b7 Get rid of last "easy" kernel symbols starting with __:
__assert -> kern_assert
__sigtimedwait1 -> sigtimedwait1
__wdstart -> wdstart1

The rest are MD and/or shared with userspace, so they will require
a little more involvement than what is available for this quick
"ride the 5.99.24 bump" action.
2010-01-19 22:28:30 +00:00
pooka c3183f3251 The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase).  Plenty of mix'n match upper/lowercase has creeped
into the tree since then.  Nuke the macros and convert all callsites
to lowercase.

no functional change
2010-01-08 11:35:07 +00:00
njoly a82811a116 Remove SYS_compat_50_mq_timedreceive/SYS_compat_50_mq_timedsend
duplicate entries.

Fix a KASSERT when unloading the compat kernel module.
2009-12-21 15:13:13 +00:00
mrg 97c80e8ff0 replace mips:elf_check_itp() and ELFNAME2(netbsd32,probe_noteless) that
it's based upon with a common compat_elf_check_interp().

tested on MALTA64 and sparc64.
2009-12-14 04:09:38 +00:00
matt e110dba586 Merge from matt-nb5-mips64 2009-12-14 00:47:10 +00:00
rmind eaddd78061 Use lwp_getpcb() in compat code, clean from struct user. 2009-11-23 00:46:06 +00:00
mbalmer 0ae57f90dd more s/the the/the/ 2009-11-22 19:09:15 +00:00
rmind 1283950019 - selcommon/pollcommon: drop redundant l argument.
- Use cached curlwp->l_fd, instead of p->p_fd.
- Inline selscan/pollscan.
2009-11-11 09:48:50 +00:00
rmind 4c1098f541 do_sys_wait(): fix previous by checking for ru != NULL. Noticed by
Onno van der Linden.  Also, remove redundant arguments (seems that
was_zombie was not used since rev 1.177 ?).
2009-11-04 21:23:02 +00:00
yamt bb529e553e compat_50_sys_aio_suspend:
- fix the buffer size.
	- use kmem_alloc instead of kmem_zalloc for buffers which we will
	  overwrite soon.
2009-10-12 23:41:51 +00:00
rmind c9a5a18df3 mq_timedsend/mq_timedreceive: timeout value is absolute, not relative.
While here, drop unecessary (since fdesc API changes) lwp_t arguments.

Bug reported by Stathis Kamperis, thanks!
2009-10-05 23:49:46 +00:00
matt 7bb407d6e3 Include <sys/exec_aout.h> explicitly instead of relying on <sys/exec.h> to
do it for you.
2009-08-15 23:39:35 +00:00
matt baf57f2df6 #include "opt_execfmt.h" and only compile innards if EXEC_AOUT is defined. 2009-08-13 03:53:13 +00:00
haad 5200b9b492 Add enum uio_seg argument to do_sys_mknod and do_sys_mkdir so these functions
can be called from kernel, too.

Change needed for zfs device node creation, until we have propoer devfs.

Oked by ad@.
2009-08-09 22:49:00 +00:00
rmind 029f6c41a7 - Use #ifdef AIO, instead of #ifdef notyet. Not a solution, but at
least gets it working for MONOLITHIC kernel.
- Similarily add #ifdef MQUEUE for mqueue compat.
- Amend TNF license to be 2-clause.  Approved by <christos>.
2009-07-19 02:41:27 +00:00
dholland effcf1af5c Convert 67 namei call sites to use namei_simple, in these functions:
check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr

All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.

XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
2009-06-29 05:08:15 +00:00
christos 2b1b4bc6ef Move the internal poll/select related API's to use timespec instead
of timeval (rides the uvm bump).
2009-03-29 19:21:19 +00:00
gmcgarry 65b9855fd5 Replace gcc initialisers with c99 designated initialisers. 2009-03-26 22:22:14 +00:00
dyoung a3bde60951 #include "opt_compat_netbsd.h" for COMPAT_20. 2009-03-17 00:08:10 +00:00
dyoung 1290eea0cb Add #include "opt_compat_netbsd.h" for COMPAT_09. 2009-03-17 00:01:54 +00:00
nakayama c99ea852e4 - fix copyout size in CLOCKCTL_O?ADJTIME.
- add missing break in CLOCKCTL_NTP_ADJTIME.
2009-02-22 13:06:58 +00:00
njoly 3e5b27ff8e Make all fstat(2) compat syscalls consistently use do_sys_fstat(),
instead of fd_getfile()/fd_putfile() dance.

ok by christos.
2009-01-26 13:00:04 +00:00
christos d3baa5ffd2 compile into nothing if not compat 50. 2009-01-21 16:12:20 +00:00
christos 143e6033a9 Provide compatibility for pre-christos-time_t sysv sysctls. 2009-01-19 19:39:41 +00:00
njoly 25a76c08aa Convert linux/linux32 wait(4) to use a compat50 rusage structure. 2009-01-17 22:28:52 +00:00
njoly 39f5db2b54 In rusage_to_rusage50() function, fix memcpy size to include last
struct member (ru_nivcsw) which was missing.

ok by christos.
2009-01-14 22:50:12 +00:00
martin 90daabb504 Add a few missing includes, so the ifdefs work as expected. 2009-01-13 20:47:47 +00:00
christos 91306aae6f fix lutimes. 2009-01-11 21:23:22 +00:00
christos 52ef6203ff *utimes should allow NULL tvp. 2009-01-11 20:46:53 +00:00
tsutsui 348730301a <sys/syscallargs.h> requires <sys/sched.h> for cpuset_t. 2009-01-11 12:19:14 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
ad 11c98a4abf PR port-amd64 modules/compat missing symbols on amd64
Also, test for compat_??_machdep.c so we don't have to grow more ifdefs
in the makefile.
2008-11-20 09:22:57 +00:00