aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2015-07-29 17:16:53 +0000
committerEd Schouten <ed@FreeBSD.org>2015-07-29 17:16:53 +0000
commite555b4309c337304587b7fda6ebda106d6854758 (patch)
treecf6982dffe49b87757079180b1fd5c615947e4a5 /sys/kern/kern_descrip.c
parent8843746ab4cf9818ef5bf400f6f5045297a42c78 (diff)
downloadsrc-e555b4309c337304587b7fda6ebda106d6854758.tar.gz
src-e555b4309c337304587b7fda6ebda106d6854758.zip
Introduce falloc_caps() to create descriptors with capabilties in place.
falloc_noinstall() followed by finstall() allows you to create and install file descriptors with custom capabilities. Add falloc_caps() that can do both of these actions in one go. This will be used by CloudABI to create pipes with custom capabilities. Reviewed by: mjg
Notes
Notes: svn path=/head/; revision=286020
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 933e4cc5cc81..dc0ee49c3851 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1707,7 +1707,8 @@ fdallocn(struct thread *td, int minfd, int *fds, int n)
* release the FILEDESC lock.
*/
int
-falloc(struct thread *td, struct file **resultfp, int *resultfd, int flags)
+falloc_caps(struct thread *td, struct file **resultfp, int *resultfd, int flags,
+ struct filecaps *fcaps)
{
struct file *fp;
int error, fd;
@@ -1716,7 +1717,7 @@ falloc(struct thread *td, struct file **resultfp, int *resultfd, int flags)
if (error)
return (error); /* no reference held on error */
- error = finstall(td, fp, &fd, flags, NULL);
+ error = finstall(td, fp, &fd, flags, fcaps);
if (error) {
fdrop(fp, td); /* one reference (fp only) */
return (error);