summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 7e54d18..4229cc9 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sbuf.h>
#include <sys/signalvar.h>
#include <sys/socketvar.h>
+#include <sys/kdb.h>
#include <sys/stat.h>
#include <sys/sx.h>
#include <sys/syscallsubr.h>
@@ -308,6 +309,24 @@ fdfree(struct filedesc *fdp, int fd)
#endif
}
+void
+pwd_ensure_dirs(void)
+{
+ struct filedesc *fdp;
+
+ fdp = curproc->p_fd;
+ FILEDESC_XLOCK(fdp);
+ if (fdp->fd_cdir == NULL) {
+ fdp->fd_cdir = rootvnode;
+ VREF(rootvnode);
+ }
+ if (fdp->fd_rdir == NULL) {
+ fdp->fd_rdir = rootvnode;
+ VREF(rootvnode);
+ }
+ FILEDESC_XUNLOCK(fdp);
+}
+
/*
* System calls on descriptors.
*/
OpenPOWER on IntegriCloud