summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
AgeCommit message (Collapse)Author
2011-11-06Negative offsets to pread/pwrite-family are only legal for character devices.Philip Guenthe
Pointed out by Alexander Polakov (polachok at gmail.com) ok deraadt@
2011-11-05ttys can't seek, so make pread/pwrite/preadv/pwritev fail with ESPIPEPhilip Guenthe
on them too ok deraadt@, miod@
2011-07-25Make sure vfsp is not used uninitialized in the mount -o update case;Miod Vallat
ok krw@ matthew@
2011-07-18Add support for UTIME_OMIT and UTIME_NOW to utimensat(2), add theMatthew Dempsky
futimens(2) system call, and refactor futimes(2) to share the same code. (As with other openat(2) system call stuff, this is not exposed to userland yet.) naddy@ pointed out rsync expects UTIME_* if openat(2) is available tweaks and ok guenther@; tested by naddy@ in a bulk build
2011-07-14Add support for AT_REMOVEDIR to unlinkat(2), and switch sys_rmdir() toMatthew Dempsky
use it. ok tedu@, guenther@
2011-07-12Fix typo that caused fchownat(2) and fchmodat(2) to try to dereferenceMatthew Dempsky
symbolic links even when the AT_SYMLINK_NOFOLLOW flag is passed. noticed by naddy@ testing gnulib ok deraadt@ and presumably tedu@ (who wrote a similar diff)
2011-07-09Fix up previous diff: use COMPAT_O48 instead of COMPAT_48, add optionMatthew Dempsky
to GENERIC, wrap compat_o48_sys_getdirentries() with an appropriate #ifdef, and use struct compat_o48_sys_getdirentries_args instead of struct sys_getdirentries_args.
2011-07-09More syscalls.master cleanup:Matthew Dempsky
sys_osigaltstack() is 7 years old and no longer needed; all glory to the sys_sigaltstack()! sys_ogetdirentries() is about 9 months old, but still acceptable within our release cycle; move from STD to COMPAT_48 to make this clearer for tedu@ next year. sys_sbrk() and sys_sstk() are completely obsolete: all they do is return ENOSYS. ok guenther@
2011-07-09Add support for the O_CLOEXEC and O_DIRECTORY flags introduced inMatthew Dempsky
POSIX Issue 7. Requested by oga@ (and maybe djm@); ok guenther@
2011-07-08Support sending struct info to kdump. So far for struct stat andOtto Moerbeek
struct sockaddress; mostly from freebsd. ok deraadt@ tedu@ nicm@
2011-07-08Add support for the AT_EACCESS, AT_SYMLINK_NOFOLLOW, andMatthew Dempsky
AT_SYMLINK_FOLLOW flags. Refactor sys_lstat to call dofstatat() with AT_SYMLINK_NOFOLLOW. Fix sys_link() to use AT_SYMLINK_FOLLOW when calling dolinkat(). Additionally, fix a bug in VOP_ACCESS() where we might sleep while not holding a reference count on the ucred object we pass down. ok tedu@
2011-07-07Add new syscall entries to support the openat(2) family of functionsMatthew Dempsky
added in POSIX Issue 7: openat(), mknodat(), mkfifoat(), linkat(), symlinkat(), unlinkat(), faccessat(), fstatat(), readlinkat(), fchmodat(), fchownat(), utimensat(), renameat(), and mkdirat(). This diff mostly just refactors the existing sys_foo() logic into a common dofooat() function that can then be called by both sys_foo() and sys_fooat(). Some of the new system calls support new flags to control their behavior, and proper support for these will be added in subsequent diffs. Incorporating suggestions from thib@, guenther@, and tedu@. ok tedu@, thib@, deraadt@, guenther@
2011-07-06Return the correct error for fchdir(not_file_or_dir)Philip Guenthe
ok matthew@ tedu@
2011-07-06VOP_GETATTR() can sleep when accessing a file over NFS, so useMatthew Dempsky
FREF()/FRELE() in lseek() so our struct file doesn't disappear in the mean time. Incorporating suggestions from tedu@ and guenther@; ok guenther@
2011-07-05Don't worry about lseek(2)ing past the end of raw disk devices. TheMatthew Dempsky
disk drivers are now smart enough to handle this correctly, as they need to also handle pread(2)/pwrite(2). ok deraadt@, krw@; ok marco@ on an similar, earlier diff
2010-10-28Change basep parameter of getdirentries() to be off_t *, not long *Todd C. Miller
so it works correctly with large offsets (and matches other systems). This requires adding a new getdirentries syscall, with the old one renamed to ogetdirentries. All in-tree consumers of getdirentries() have been updated. Bump libc and libpthread major numbers. OK and with deraadt@
2010-10-27The previous two commits cannot be right. If in fact offsets > 4GB areTheo de Raadt
causing problems, then it is nonsense to instead fail at the 2GB line. Much more discussion needed.
2010-07-01Oops. Lost the < 0 check on file position I had in the circulatedKenneth R Westerback
diff. A bit of paranoia suggested by beck@.
2010-07-01Return EINVAL if the file position is greater than LONG_MAX, sinceKenneth R Westerback
otherwise truncation will occur on archs where LONG LONG and LONG are not the same. Noticed at n2k10. Error return suggested by deraadt@. ok beck@ millert@ deraadt@ guenther@
2010-06-29Remove the "if the string address faulted, see if it looks like an int"Ted Unangst
4.3 compat code in mount. This is a flag day for those of you still running 4.3 BSD binaries on your vaxen. :) ok deraadt dlg guenther thib
2010-06-29eliminate some very redundant SCARG usage. ok artTed Unangst
2009-10-31Use suser when possible. Suggested by miod@.Federico G. Schwindt
miod@ deraadt@ ok.
2009-09-08copyout() the correct size in sys_fhstatfs(), broken since 1.138.Miod Vallat
ok millert@ blambert@ otto@
2009-09-02check if we have access to the vnode before checking if we can write toFederico G. Schwindt
it. thib@ ok'd the idea and an earlier diff.
2009-07-09Remove the VREF() macro and replaces all instances with a call to verf(),Thordur I. Bjornsson
which is exactly what the macro does. Macro's that are nothing more then: #define FUNCTION(arg) function(arg) are almost always pointless and should go away. OK blambert@ Agreed by many.
2009-06-04Put readv/writev changes back in, as they no longer hang ckuethe's ntpd.Bret Lambert
Special thanks to ckuethe's ntpd for noticing the problem. ok deraadt@
2009-06-03Revert readv/writev changes, as they trigger an apparent file descriptorBret Lambert
deadlock for ckuethe@ "if you have to revert, you have to revert" deraadt@
2009-06-02dofile{read,write} are essentially identical to their iovec equivalents,Bret Lambert
dofile{read,write}v, so remove the former and rework it so that everything uses the latter "nice" deraadt@ "reads ok" oga@ spastic 'OMG Ponies!!!!' weingart@
2008-11-11make sure that any messing we do with a process's directories happens ↵Ted Unangst
atomically and not after sleeping. ok deraadt pedro
2008-11-01change vrele() to return an int. if it returns 0, it can gaurantee thatTheo de Raadt
it did not sleep. this is used to avoid checkdirs() to avoid having to restart the allproc walk every time through idea from tedu, ok thib pedro
2008-10-31checkdirs() walks allproc and calls sleeping functions if directories haveTheo de Raadt
to be snapped. Change it so that everytime it sleeps it restarts from the top of the list. ok art
2008-08-08remove an if notyet block from sys_fstatfs(), that will never be needed,Thordur I. Bjornsson
softupdates are reported too statfs via other means. missed this block in in rev1.148 where the same block was removed from sys_statfs().
2008-07-28remove an #if noyet block that will never be needed.Thordur I. Bjornsson
softupdates are reported too statfs via the mount point flags or the mount_info part of statfs; ok pedro@
2008-06-13Delete vfs_bufstats() leftovers and unbreak compile with -DDEBUGRainer Giedat
Ok reyk@, "kill kill kill" thib@
2008-05-22Use LIST_FOREACH() instead of handrolling.Thordur I. Bjornsson
From: Pierre Riteau pierre.riteau_att_gmail.com OK miod@
2008-01-22Fix a double VOP_UNLOCK() that was introduced into the error pathTodd C. Miller
in rev 1.141. From Christian Ehrhardt and Pedro Martelletto. OK hshoexer@ miod@
2007-11-28a few more places where getmicrotime is good enough. ok miodTed Unangst
2007-09-07Use M_ZERO in a few more places to shave bytes from the kernel.Artur Grabowski
eyeballed and ok dlg@
2007-08-30Fix lock ordering problems when updating mount points, in someThordur I. Bjornsson
cases we could end up releasing an unlocked lock. fixes pr's 5534 and 5564, confirmed by submitters. thanks!. ok art@
2007-08-06Fix error path in sys_fhopen() if VOP_ADVLOCK fails. Spotted by aaron@Todd C. Miller
2007-06-14Forgotten hackton diff: bounds check for seek on special devicesOtto Moerbeek
with a disklabel. Original diff from pedro@; ok pedro@ deraadt@
2007-01-16Retire VOP_LEASE(); It was a bit for NQNFS and hasThordur I. Bjornsson
effectively been a no-op for quite some time now, without promise for future usage. ok pedro@ Testing by krw@ (earlier diff) and Johan Mson Lindman (tybollt@solace.miun.se)
2006-11-24When copying out struct statfs to userland, we need to zero out the fsidArtur Grabowski
field unless it's root that's asking. This far, this has been done by putting a struct statfs on the stack and modifying it. struct statfs is large. Large things on the stack are bad. Create copyout_statfs() that copies out a struct statfs to userland, does the necessary root check and gives userland what it needs withtout wasting stack space. pedro@, deraadt@ ok.
2006-06-25rename vfs_busy() flags VB_UMIGNORE/VB_UMWAIT to VB_NOWAIT/VB_WAITNikolay Sturm
requested by and ok pedro
2006-06-14move vfs_busy() to rwlocks and properly hide the locking api from vfsNikolay Sturm
ok tedu, pedro
2006-05-27remove useless error check and irritating commentNikolay Sturm
ok pedro
2006-04-30remove the simplelock argument from vfs_busy() which is currently notNikolay Sturm
used and will never be used this way in VFS requested by and ok pedro, ok krw, biorn
2006-04-19Remove unused mount list simple_lock() gooPedro Martelletto
2006-03-26do per file io accounting and show that in fstat as well; pedro@ marco@ okMichael Shalayeff
2006-01-07p_dupfd need only be -1, nothing else. but this is nothing like what aaron ↵Theo de Raadt
has coming...