aboutsummaryrefslogtreecommitdiff
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Retire linprocfs_doargv(). Instead use new functions, proc_getargv()Mikolaj Golub2011-11-221-146/+14
| | | | | | | | | | | | | and proc_getenvv(), which were implemented using linprocfs_doargv() as a reference. Suggested by: kib Reviewed by: kib Approved by: des (linprocfs maintainer) MFC after: 2 weeks Notes: svn path=/head/; revision=227836
* - Add the ffclock_getcounter(), ffclock_getestimate() and ffclock_setestimate()Lawrence Stewart2011-11-216-9/+81
| | | | | | | | | | | | | | | | | | | | | | | system calls to provide feed-forward clock management capabilities to userspace processes. ffclock_getcounter() returns the current value of the kernel's feed-forward clock counter. ffclock_getestimate() returns the current feed-forward clock parameter estimates and ffclock_setestimate() updates the feed-forward clock parameter estimates. - Document the syscalls in the ffclock.2 man page. - Regenerate the script-derived syscall related files. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ Submitted by: Julien Ridoux (jridoux at unimelb edu au) Notes: svn path=/head/; revision=227776
* Make the Linux *at() calls a bit more complete.Ed Schouten2011-11-192-14/+16
| | | | | | | | | | Properly support: - AT_EACCESS for faccessat(), - AT_SYMLINK_FOLLOW for linkat(). Notes: svn path=/head/; revision=227693
* Regenerate system call tables.Ed Schouten2011-11-199-12/+12
| | | | Notes: svn path=/head/; revision=227692
* Improve *access*() parameter name consistency.Ed Schouten2011-11-194-11/+11
| | | | | | | | | | | | The current code mixes the use of `flags' and `mode'. This is a bit confusing, since the faccessat() function as a `flag' parameter to store the AT_ flag. Make this less confusing by using the same name as used in the POSIX specification -- `amode'. Notes: svn path=/head/; revision=227691
* - Split out a kern_posix_fadvise() from the posix_fadvise() system call soJohn Baldwin2011-11-141-11/+4
| | | | | | | | | | it can be used by in-kernel consumers. - Make kern_posix_fallocate() public. - Use kern_posix_fadvise() and kern_posix_fallocate() to implement the freebsd32 wrappers for the two system calls. Notes: svn path=/head/; revision=227502
* struct timespec32: change types of tv_sec and tv_nsec fields to signedSergey Kandaurov2011-11-111-2/+2
| | | | | | | | | | | | to match native struct timespec ABI on __LP32__. This change is a prerequisite for upcoming futimens()/utimensat() in whose implementations it is assumed that timespec32 can take a negative value. MFC after: 1 week Notes: svn path=/head/; revision=227447
* Correct the types of the arguments to return probes of the syscallRyan Stone2011-11-111-1/+1738
| | | | | | | | | | | provider. Previously we were erroneously supplying the argument types of the corresponding entry probe. Reviewed by: rpaulo MFC after: 1 week Notes: svn path=/head/; revision=227441
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-073-3/+4
| | | | | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-071-2/+2
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* Regen.John Baldwin2011-11-045-6/+54
| | | | Notes: svn path=/head/; revision=227071
* Add the posix_fadvise(2) system call. It is somewhat similar toJohn Baldwin2011-11-042-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | madvise(2) except that it operates on a file descriptor instead of a memory region. It is currently only supported on regular files. Just as with madvise(2), the advice given to posix_fadvise(2) can be divided into two types. The first type provide hints about data access patterns and are used in the file read and write routines to modify the I/O flags passed down to VOP_READ() and VOP_WRITE(). These modes are thus filesystem independent. Note that to ease implementation (and since this API is only advisory anyway), only a single non-normal range is allowed per file descriptor. The second type of hints are used to hint to the OS that data will or will not be used. These hints are implemented via a new VOP_ADVISE(). A default implementation is provided which does nothing for the WILLNEED request and attempts to move any clean pages to the cache page queue for the DONTNEED request. This latter case required two other changes. First, a new V_CLEANONLY flag was added to vinvalbuf(). This requests vinvalbuf() to only flush clean buffers for the vnode from the buffer cache and to not remove any backing pages from the vnode. This is used to ensure clean pages are not wired into the buffer cache before attempting to move them to the cache page queue. The second change adds a new vm_object_page_cache() method. This method is somewhat similar to vm_object_page_remove() except that instead of freeing each page in the specified range, it attempts to move clean pages to the cache queue if possible. To preserve the ABI of struct file, the f_cdevpriv pointer is now reused in a union to point to the currently active advice region if one is present for regular files. Reviewed by: jilles, kib, arch@ Approved by: re (kib) MFC after: 1 month Notes: svn path=/head/; revision=227070
* Control the execution permission of the readable segments forKonstantin Belousov2011-10-151-2/+2
| | | | | | | | | | i386 binaries on the amd64 and ia64 with the sysctl, instead of unconditionally enabling it. Reviewed by: marcel Notes: svn path=/head/; revision=226388
* Regen.John Baldwin2011-10-145-12/+12
| | | | Notes: svn path=/head/; revision=226365
* Use PAIR32TO64() for the offset and length parameters toJohn Baldwin2011-10-142-4/+4
| | | | | | | | | | freebsd32_posix_fallocate() to properly handle big-endian platforms. Reviewed by: mdf MFC after: 1 week Notes: svn path=/head/; revision=226364
* Use PTRIN().Marcel Moolenaar2011-10-131-1/+1
| | | | Notes: svn path=/head/; revision=226353
* Wrap mprotect(2) so that we can add execute permissions when readMarcel Moolenaar2011-10-136-10/+32
| | | | | | | | permissions are requested. This is needed on amd64 and ia64 for JDK 1.4.x Notes: svn path=/head/; revision=226349
* Wrap mprotect(2)Marcel Moolenaar2011-10-131-1/+1
| | | | Notes: svn path=/head/; revision=226348
* In freebsd32_mmap() and when compiling for amd64 or ia64, alsoMarcel Moolenaar2011-10-131-0/+5
| | | | | | | | ask for execute permissions when read permissions are wanted. This is needed for JDK 1.4.x on i386. Notes: svn path=/head/; revision=226347
* Add curly braces missed in r226247.Christian Brueffer2011-10-111-1/+2
| | | | | | | | | Pointy hat to: brueffer Submitted by: many MFC after: 1 week Notes: svn path=/head/; revision=226253
* Properly free linux_gidset in case of an error.Christian Brueffer2011-10-111-0/+1
| | | | | | | | | CID: 4136 Found with: Coverity Prevent(tm) MFC after: 1 week Notes: svn path=/head/; revision=226247
* Use the caculated length instead of maximum length.Jung-uk Kim2011-10-061-2/+2
| | | | Notes: svn path=/head/; revision=226079
* Remove a now-defunct variable.Jung-uk Kim2011-10-061-16/+15
| | | | Notes: svn path=/head/; revision=226078
* Use uint32_t instead of u_int32_t. Fix style(9) nits.Jung-uk Kim2011-10-061-10/+9
| | | | Notes: svn path=/head/; revision=226074
* Make sure to ignore the leading NULL byte from Linux abstract namespace.Jung-uk Kim2011-10-061-2/+10
| | | | Notes: svn path=/head/; revision=226073
* Restore the original socket address length if it was not really AF_INET6.Jung-uk Kim2011-10-061-16/+19
| | | | Notes: svn path=/head/; revision=226072
* Retern more appropriate errno when Linux path name is too long.Jung-uk Kim2011-10-061-1/+1
| | | | Notes: svn path=/head/; revision=226071
* Inline do_sa_get() function and remove an unused return value.Jung-uk Kim2011-10-061-23/+9
| | | | Notes: svn path=/head/; revision=226069
* Unroll inlined strnlen(9) and make it easier to read. No functional change.Jung-uk Kim2011-10-061-10/+6
| | | | Notes: svn path=/head/; revision=226068
* Fix a bug in UNIX socket handling in the linux emulator which wasColin Percival2011-10-041-0/+15
| | | | | | | | | | | | exposed by the security fix in FreeBSD-SA-11:05.unix. Approved by: so (cperciva) Approved by: re (kib) Security: Related to FreeBSD-SA-11:05.unix, but not actually a security fix. Notes: svn path=/head/; revision=226023
* Auto-generated code from sys_ prefixing makesyscalls.sh changeKip Macy2011-09-165-297/+297
| | | | | | | Approved by: re(bz) Notes: svn path=/head/; revision=225618
* In order to maximize the re-usability of kernel code in user space thisKip Macy2011-09-1619-231/+240
| | | | | | | | | | | | | | | | patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz) Notes: svn path=/head/; revision=225617
* Add experimental support for process descriptorsJonathan Anderson2011-08-181-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A "process descriptor" file descriptor is used to manage processes without using the PID namespace. This is required for Capsicum's Capability Mode, where the PID namespace is unavailable. New system calls pdfork(2) and pdkill(2) offer the functional equivalents of fork(2) and kill(2). pdgetpid(2) allows querying the PID of the remote process for debugging purposes. The currently-unimplemented pdwait(2) will, in the future, allow querying rusage/exit status. In the interim, poll(2) may be used to check (and wait for) process termination. When a process is referenced by a process descriptor, it does not issue SIGCHLD to the parent, making it suitable for use in libraries---a common scenario when using library compartmentalisation from within large applications (such as web browsers). Some observers may note a similarity to Mach task ports; process descriptors provide a subset of this behaviour, but in a UNIX style. This feature is enabled by "options PROCDESC", but as with several other Capsicum kernel features, is not enabled by default in GENERIC 9.0. Reviewed by: jhb, kib Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Notes: svn path=/head/; revision=224987
* Second-to-last commit implementing Capsicum capabilities in the FreeBSDRobert Watson2011-08-1110-37/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel for FreeBSD 9.0: Add a new capability mask argument to fget(9) and friends, allowing system call code to declare what capabilities are required when an integer file descriptor is converted into an in-kernel struct file *. With options CAPABILITIES compiled into the kernel, this enforces capability protection; without, this change is effectively a no-op. Some cases require special handling, such as mmap(2), which must preserve information about the maximum rights at the time of mapping in the memory map so that they can later be enforced in mprotect(2) -- this is done by narrowing the rights in the existing max_protection field used for similar purposes with file permissions. In namei(9), we assert that the code is not reached from within capability mode, as we're not yet ready to enforce namespace capabilities there. This will follow in a later commit. Update two capability names: CAP_EVENT and CAP_KEVENT become CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they represent. Approved by: re (bz) Submitted by: jonathan Sponsored by: Google Inc Notes: svn path=/head/; revision=224778
* Implement the linprocfs swaps file, providing information about theKonstantin Belousov2011-08-011-0/+29
| | | | | | | | | | | | | configured swap devices in the Linux-compatible format. Based on the submission by: Robert Millan <rmh debian org> PR: kern/159281 Reviewed by: bde Approved by: re (kensmith) MFC after: 2 weeks Notes: svn path=/head/; revision=224582
* Rename ki_ocomm to ki_tdname and OCOMMLEN to TDNAMLEN.Bjoern A. Zeeb2011-07-181-1/+1
| | | | | | | | | | | | Provide backward compatibility defines under BURN_BRIDGES. Suggested by: jhb Reviewed by: emaste Sponsored by: Sandvine Incorporated Approved by: re (kib) Notes: svn path=/head/; revision=224199
* Correct small typo in a do{}while(0) defineDmitry Morozovsky2011-07-171-1/+1
| | | | | | | | Approved by: kib MFC after: 2 weeks Notes: svn path=/head/; revision=224140
* Remove the 'either' from the comment as it'll be less obvious that weBjoern A. Zeeb2011-07-171-4/+4
| | | | | | | | | removed semmap in a bit of time from now. Re-wrap. Suggested by: jhb Notes: svn path=/head/; revision=224123
* Auto-generated system call code with cap_new(), cap_getrights().Jonathan Anderson2011-07-155-8/+52
| | | | | | | | Approved by: mentor (rwatson), re (Capsicum blanket) Sponsored by: Google Inc Notes: svn path=/head/; revision=224067
* Add cap_new() and cap_getrights() system calls.Jonathan Anderson2011-07-151-2/+3
| | | | | | | | | | | | Implement two previously-reserved Capsicum system calls: - cap_new() creates a capability to wrap an existing file descriptor - cap_getrights() queries the rights mask of a capability. Approved by: mentor (rwatson), re (Capsicum blanket) Sponsored by: Google Inc Notes: svn path=/head/; revision=224066
* Remove semaphore map entry count "semmap" field and its tuningBjoern A. Zeeb2011-07-141-1/+9
| | | | | | | | | | | | | | option that is highly recommended to be adjusted in too much documentation while doing nothing in FreeBSD since r2729 (rev 1.1). ipcs(1) needs to be recompiled as it is accessing _KERNEL private variables. Reviewed by: jhb (before comment change on linux code) Sponsored by: Sandvine Incorporated Notes: svn path=/head/; revision=224016
* Return empty cmdline/environ string for processes with kernel addressSergey Kandaurov2011-06-171-0/+18
| | | | | | | | | | | | | space. This is consistent with the behavior in linux. PR: kern/157871 Reported by: Petr Salinger <Petr Salinger att seznam cz> Verified on: GNU/kFreeBSD debian 8.2-1-amd64 (by reporter) Reviewed by: kib (some time ago) MFC after: 2 weeks Notes: svn path=/head/; revision=223182
* Regen.Konstantin Belousov2011-06-164-7/+14
| | | | Notes: svn path=/head/; revision=223167
* Implement compat32 for old lseek, for the a.out binaries on amd64.Konstantin Belousov2011-06-162-1/+15
| | | | Notes: svn path=/head/; revision=223166
* Commit the missing linux_videdev2_compat.h (lost somewhere betweenAlexander Leidinger2011-05-041-0/+137
| | | | | | | | | commit tree patch generation -> successful compile tree build test -> commmit). Pointy hat to: netchild Notes: svn path=/head/; revision=221434
* Add FEATURE macros for v4l and v4l2 to the linuxulator.Alexander Leidinger2011-05-041-0/+4
| | | | | | | Suggested by: ae Notes: svn path=/head/; revision=221428
* This is v4l2 support for the linuxulator. This allows to access FreeBSDAlexander Leidinger2011-05-042-0/+403
| | | | | | | | | | | | native devices which support the v4l2 API from processes running within the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd or multimedia/webcamd supplied drivers. Submitted by: nox MFC after: 1 month Notes: svn path=/head/; revision=221426
* Fix typo in comment, improve comment.Alexander Leidinger2011-05-041-2/+2
| | | | Notes: svn path=/head/; revision=221425
* Add explanation about the use-permission and FreeBSDify it.Alexander Leidinger2011-05-041-0/+15
| | | | Notes: svn path=/head/; revision=221424
* Copy the v4l2 header unchanged from the vendor branch.Alexander Leidinger2011-05-041-0/+1164
| | | | Notes: svn path=/head/; revision=221423