summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Add TIOCPKT and TIOCSPTLCK to the Linuxolator.ed2008-07-232-1/+9
| | | | | | | | | | | | We're very lucky, because the flags used by our TIOCPKT implementation are the same as flags used by Linux. We can safely enable TIOCPKT, assuming EXTPROC is not used. TIOCSPTLCK is used by unlockpt(). Because we don't need unlockpt() in our implementation, make this ioctl a no-op. Approved by: philip (mentor, implicit), rdivacky Obtained from: P4 (//depot/projects/mpsafetty/...)
* Fix linux_alarm, the linux behaviour is to limit therdivacky2008-07-231-3/+6
| | | | | | | | secs to INT_MAX when the passed in parameter is bigger than INT_MAX. Submitted by: Dmitry Chagin <chagin.dmitry gmail com> Approved by: kib (mentor)
* when NDIS framework try to query/set informations NDIS drivers canweongyo2008-07-231-5/+7
| | | | | | | | | | return NDIS_STATUS_PENDING. In this case, it's waiting for 5 secs to get the response from drivers now. However, some NDIS drivers can send the response before NDIS framework gets ready to receive it so we might always be blocked for 5 secs in current implementation. NDIS framework should reset the event before calling NDIS driver's callback not after. MFC after: 1 month
* style(9): put parentheses around return values.brooks2008-07-101-4/+4
|
* Regenbrooks2008-07-104-16/+53
|
* id_t is a 64-bit integer and thus is passed as two arguments like off_t is.brooks2008-07-102-7/+70
| | | | | | | As a result, those arguments must be recombined before calling the real syscal implementation. This change fixes 32-bit compatibility for cpuset_getid(), cpuset_setid(), cpuset_getaffinity(), and cpuset_setaffinity().
* Introduce a new lock, hostname_mtx, and use it to synchronize accessrwatson2008-07-052-0/+3
| | | | | | | | | | | | to global hostname and domainname variables. Where necessary, copy to or from a stack-local buffer before performing copyin() or copyout(). A few uses, such as in cd9660 and daemon_saver, remain under-synchronized and will require further updates. Correct a bug in which a failed copyin() of domainname would leave domainname potentially corrupted. MFC after: 3 weeks
* Silence warning about missing IoGetDeviceObjectPointer by implementingcokane2008-06-151-0/+13
| | | | | | | | a simple stub that always returns STATUS_SUCCESS. Submitted by: Paul B. Mahol <onemda@gmail.com> Reviewed by: thompsa MFC after: 1 week
* Remove obselete PECOFF image activator support.wkoszek2008-06-142-748/+0
| | | | | | | | PRs assigned at the time of removal: kern/80742 Discussed on: freebsd-current (silence), IRC Tested by: make universe Approved by: cognet (mentor)
* fix a page fault that it occurred during ifp is NULL. This bug happensweongyo2008-06-111-2/+2
| | | | | when NDIS driver's initialization is failed and NDIS driver's trying to call NdisWriteErrorLogEntry().
* d_ino member of linux_dirent structure should be unsigned long.rdivacky2008-06-081-2/+2
| | | | | Submitted by: Chagin Dmitry <chagin.dmitry@gmail.com> Approved by: kib (mentor)
* Switch to emulating Linux 2.6 on default.rdivacky2008-06-031-2/+2
| | | | Approved by: kib (mentor)
* Push down the major/minor conversion for pts/%u to improve consistency.ed2008-06-022-26/+20
| | | | | | | | | | | | | | | | | | In the mpsafetty branch, Linux sshd seems to work properly inside a jail. Some small modifications had to be made to the Linux compatibility layer. The Linux PTY routines always expect the device major number to be 136 or higher. Our code always set the major/minor number pair to 136:0. This makes routines like ttyname() and ptsname() fail, because we'll end up having ambiguous device numbers. The conversion was not performed on all *stat() routines, which meant in some cases the numbers didn't get transformed. By pushing the conversion into linux_driver_get_major_minor(), the transformation will take place on all calls. Approved by: philip (mentor), rdivacky
* Fix a panic that a priority value which is passed to cv_broadcastpri(9)weongyo2008-05-301-4/+6
| | | | | | | can be < 0. We don't ignore a `increment' argument but at least we keep a priority value of NDIS threads over PRI_MIN_KERN. Reviewed by: thompsa
* Fix a panic when it occurred during initializing the ndis driver becauseweongyo2008-05-151-0/+4
| | | | | | | it try to read network address through ifnet structure which is NULL until the ndis driver's initialization is finished. Reviewed by: thompsa
* Implement robust futexes. Most of the code is modelled afterrdivacky2008-05-135-7/+192
| | | | | | | | | | | what Linux does. This is because robust futexes are mostly userspace thing which we cannot alter. Two syscalls maintain pointer to userspace list and when process exits a routine walks this list waking up processes sleeping on futexes from that list. Reviewed by: kib (mentor) MFC after: 1 month
* Implement linux_truncate64() syscall.rdivacky2008-04-231-0/+18
| | | | | Tested by: Aline de Freitas <aline@riseup.net> Approved by: kib (mentor)
* The vmspace->vm_daddr is constant until freed, there is no needrdivacky2008-04-211-2/+0
| | | | | | to hold lock while accessing it. Approved by: kib (mentor)
* Remove using magic value of -1 to distinguish between linux_open()rdivacky2008-04-091-5/+3
| | | | | | | | | and linux_openat(). Instead just pass AT_FDCWD into linux_common_open() for the linux_open() case. This prevents passing -1 as a dirfd to openat() from succeeding which is wrong. Suggested by: rwatson, kib Approved by: kib (mentor)
* Implement the linux syscallskib2008-04-087-124/+418
| | | | | | | | | openat, mkdirat, mknodat, fchownat, futimesat, fstatat, unlinkat, renameat, linkat, symlinkat, readlinkat, fchmodat, faccessat. Submitted by: rdivacky Sponsored by: Google Summer of Code 2007 Tested by: pho
* Regenkib2008-03-314-5/+72
|
* Add the freebsd32 compatibility shims for the *at() syscalls.kib2008-03-312-7/+90
| | | | | Reviewed by: rwatson, rdivacky Tested by: pho
* Add the support for the AT_FDCWD and fd-relative name lookups to thekib2008-03-315-0/+5
| | | | | | | | | namei(9). Based on the submission by rdivacky, sponsored by Google Summer of Code 2007 Reviewed by: rwatson, rdivacky Tested by: pho
* Remove files that have been repo copied to their new locationjb2008-03-2860-5506/+0
| | | | in cddl-specific parts of the source tree.
* Regen.dfr2008-03-264-6/+6
|
* Add the new kernel-mode NFS Lock Manager. To use it instead of thedfr2008-03-263-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | user-mode lock manager, build a kernel with the NFSLOCKD option and add '-k' to 'rpc_lockd_flags' in rc.conf. Highlights include: * Thread-safe kernel RPC client - many threads can use the same RPC client handle safely with replies being de-multiplexed at the socket upcall (typically driven directly by the NIC interrupt) and handed off to whichever thread matches the reply. For UDP sockets, many RPC clients can share the same socket. This allows the use of a single privileged UDP port number to talk to an arbitrary number of remote hosts. * Single-threaded kernel RPC server. Adding support for multi-threaded server would be relatively straightforward and would follow approximately the Solaris KPI. A single thread should be sufficient for the NLM since it should rarely block in normal operation. * Kernel mode NLM server supporting cancel requests and granted callbacks. I've tested the NLM server reasonably extensively - it passes both my own tests and the NFS Connectathon locking tests running on Solaris, Mac OS X and Ubuntu Linux. * Userland NLM client supported. While the NLM server doesn't have support for the local NFS client's locking needs, it does have to field async replies and granted callbacks from remote NLMs that the local client has contacted. We relay these replies to the userland rpc.lockd over a local domain RPC socket. * Robust deadlock detection for the local lock manager. In particular it will detect deadlocks caused by a lock request that covers more than one blocking request. As required by the NLM protocol, all deadlock detection happens synchronously - a user is guaranteed that if a lock request isn't rejected immediately, the lock will eventually be granted. The old system allowed for a 'deferred deadlock' condition where a blocked lock request could wake up and find that some other deadlock-causing lock owner had beaten them to the lock. * Since both local and remote locks are managed by the same kernel locking code, local and remote processes can safely use file locks for mutual exclusion. Local processes have no fairness advantage compared to remote processes when contending to lock a region that has just been unlocked - the local lock manager enforces a strict first-come first-served model for both local and remote lockers. Sponsored by: Isilon Systems PR: 95247 107555 115524 116679 MFC after: 2 weeks
* Regen.jhb2008-03-254-6/+21
|
* Add entries for the cpuset-related system calls. The existing system callsjhb2008-03-251-0/+12
| | | | | | can be used on little endian systems. Pointy hat to: jeff
* Fix build.ru2008-03-251-2/+2
| | | | Reported by: ache, tinderbox
* o Add stub support for some new futex operations,rdivacky2008-03-202-2/+29
| | | | | | | | | | | | | | | | | so the annoying message is not printed. o Don't warn about FUTEX_FD not being implemented and return ENOSYS instead of 0 (eg. success). o Clear FUTEX_PRIVATE_FLAG as we actually implement only private futexes so there is no reason to return ENOSYS when app asks for a private futex. We don't reject shared futexes because they worked just fine with our implementation so far. Approved by: kib (mentor) Tested by: bsam MFC after: 1 week
* Simplify fcntl(SVR4_F_DUP2FD) code now that FreeBSD has F_DUP2FD.antoine2008-03-171-13/+3
| | | | Approved by: rwatson (mentor)
* Implement sched_setaffinity and get_setaffinity usingrdivacky2008-03-161-9/+40
| | | | | | | real cpu affinity setting primitives. Reviewed by: jeff Approved by: kib (mentor)
* - The P_SA flag has been removed. Don't reference it in a KASSERT.jeff2008-03-121-2/+1
|
* Remove kernel support for M:N threading.jeff2008-03-124-22/+15
| | | | | | | | While the KSE project was quite successful in bringing threading to FreeBSD, the M:N approach taken by the kse library was never developed to its full potential. Backwards compatibility will be provided via libmap.conf for dynamically linked binaries and static binaries will be broken.
* Return ENOSYS instead of 0 for the unknown futex operations.kib2008-03-021-1/+1
| | | | | Submitted by: rdivacky Reported and tested by: Gary Stanley <gary velocity-servers net>
* Sanitize arguments to linux_mremap().kib2008-02-222-0/+18
| | | | | | | | Check that only MREMAP_FIXED and MREMAP_MAYMOVE flags are specified. Check for the page alignment of the addr argument. Submitted by: rdivacky MFC after: 1 week
* Regenerate for readlink(2).ru2008-02-124-4/+4
|
* Change readlink(2)'s return type and type of the last argumentru2008-02-121-2/+2
| | | | | | to match POSIX. Prodded by: Alexey Lyashkov
* Give MEXTADD() another argument to make both void pointers to thephk2008-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | free function controlable, instead of passing the KVA of the buffer storage as the first argument. Fix all conventional users of the API to pass the KVA of the buffer as the first argument, to make this a no-op commit. Likely break the only non-convetional user of the API, after informing the relevant committer. Update the mbuf(9) manual page, which was already out of sync on this point. Bump __FreeBSD_version to 800016 as there is no way to tell how many arguments a CPP macro needs any other way. This paves the way for giving sendfile(9) a way to wait for the passed storage to have been accessed before returning. This does not affect the memory layout or size of mbufs. Parental oversight by: sam and rwatson. No MFC is anticipated.
* Change type of kmem_used() and kmem_size() functions to uint64_t, so itpjd2008-01-242-6/+6
| | | | | | | | | | | | | doesn't overflow in arc.c in this check: if (kmem_used() > (kmem_size() * 4) / 5) return (1); With this bug ZFS almost doesn't cache. Only 32bit machines are affected that have vm.kmem_size set to values >=1GB. Reported by: David Taylor <davidt@yadt.co.uk>
* Regenerate.rwatson2008-01-204-6/+6
|
* Use audit events AUE_SHMOPEN and AUE_SHMUNLINK with new system callsrwatson2008-01-201-2/+2
| | | | | shm_open() and shm_unlink(). More auditing will need to be done for these calls to capture arguments properly.
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inattilio2008-01-1310-24/+21
| | | | | | | | | | | conjuction with 'thread' argument passing which is always curthread. Remove the unuseful extra-argument and pass explicitly curthread to lower layer functions, when necessary. KPI results broken by this change, which should affect several ports, so version bumping and manpage update will be further committed. Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>
* vn_lock() is currently only used with the 'curthread' passed as argument.attilio2008-01-1010-15/+15
| | | | | | | | | | | | | | | | Remove this argument and pass curthread directly to underlying VOP_LOCK1() VFS method. This modify makes the code cleaner and in particular remove an annoying dependence helping next lockmgr() cleanup. KPI results, obviously, changed. Manpage and FreeBSD_version will be updated through further commits. As a side note, would be valuable to say that next commits will address a similar cleanup about VFS methods, in particular vop_lock1 and vop_unlock. Tested by: Diego Sardina <siarodx at gmail dot com>, Andrea Di Pasquale <whyx dot it at gmail dot com>
* Regen for shm_open(2) and shm_unlink(2).jhb2008-01-084-5/+11
|
* Add a new file descriptor type for IPC shared memory objects and use it tojhb2008-01-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | implement shm_open(2) and shm_unlink(2) in the kernel: - Each shared memory file descriptor is associated with a swap-backed vm object which provides the backing store. Each descriptor starts off with a size of zero, but the size can be altered via ftruncate(2). The shared memory file descriptors also support fstat(2). read(2), write(2), ioctl(2), select(2), poll(2), and kevent(2) are not supported on shared memory file descriptors. - shm_open(2) and shm_unlink(2) are now implemented as system calls that manage shared memory file descriptors. The virtual namespace that maps pathnames to shared memory file descriptors is implemented as a hash table where the hash key is generated via the 32-bit Fowler/Noll/Vo hash of the pathname. - As an extension, the constant 'SHM_ANON' may be specified in place of the path argument to shm_open(2). In this case, an unnamed shared memory file descriptor will be created similar to the IPC_PRIVATE key for shmget(2). Note that the shared memory object can still be shared among processes by sharing the file descriptor via fork(2) or sendmsg(2), but it is unnamed. This effectively serves to implement the getmemfd() idea bandied about the lists several times over the years. - The backing store for shared memory file descriptors are garbage collected when they are not referenced by any open file descriptors or the shm_open(2) virtual namespace. Submitted by: dillon, peter (previous versions) Submitted by: rwatson (I based this on his version) Reviewed by: alc (suggested converting getmemfd() to shm_open())
* After applying LCONVPATH() to the path, do use the converted pathkib2008-01-051-9/+13
| | | | | | | | instead of original user-mode string in the linux_stat() and linux_lstat() syscalls. Tested by: Peter Holm MFC after: 3 days
* Remove explicit locking of struct file.jeff2007-12-301-4/+0
| | | | | | | | | | | | | - Introduce a finit() which is used to initailize the fields of struct file in such a way that the ops vector is only valid after the data, type, and flags are valid. - Protect f_flag and f_count with atomic operations. - Remove the global list of all files and associated accounting. - Rewrite the unp garbage collection such that it no longer requires the global list of all files and instead uses a list of all unp sockets. - Mark sockets in the accept queue so we don't incorrectly gc them. Tested by: kris, pho
* Plug the leaks in the present (hopefully, soon to be replaced)kib2007-12-291-12/+19
| | | | | | | implementation of the linux_openat() for the quick MFC. Reported and tested by: Peter Holm MFC after: 3 days
* Apply the LCONVPATH() to the (old) linux_stat() and linux_lstat() syscalls.kib2007-12-291-3/+12
| | | | | | | | | | | | Without it, code has two problems: - behaviour of the old and new [l]stat are different with regard of the /compat/linux - directly accessing the userspace data from the kernel asks for the panics. Reported and tested by: Peter Holm Reviewed by: rdivacky MFC after: 3 days
OpenPOWER on IntegriCloud