AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
devpts.c File Reference

devpts: the filesystem of the pseudo-terminals' slave devices, usually mounted on /dev/pts. More...

#include <core/system.h>
#include <core/module.h>
#include <core/time.h>
#include <fs/vfs.h>
#include <fs/tmpfs.h>
#include <fs/devpts.h>

Go to the source code of this file.

Functions

int devpts_init ()
 Sets devpts up at boot: tmpfs's operations, and its root directory.
int devpts_mount (struct vnode *dir, int flags, void *data)
 Mounts devpts on a directory: its one root directory is bound there.

Variables

struct vnode * devpts_root = NULL
struct fs devpts

Detailed Description

devpts: the filesystem of the pseudo-terminals' slave devices, usually mounted on /dev/pts.

Like devfs, it is a tmpfs with one root of its own, where opening /dev/ptmx makes /dev/pts/<n>.

Definition in file devpts.c.

Function Documentation

◆ devpts_init()

int devpts_init ( )

Sets devpts up at boot: tmpfs's operations, and its root directory.

Returns
0, or a negative errno

Definition at line 23 of file devpts.c.

References vnode::atime, vnode::ctime, devpts, devpts_init(), devpts_root, fs::fops, vnode::fs, gettime(), vnode::ino, kfree(), kmalloc(), M_ZERO, vnode::mode, vnode::mtime, vnode::nlink, NULL, tmpfs, vfs_install(), and fs::vops.

Referenced by devpts_init().

◆ devpts_mount()

int devpts_mount ( struct vnode * dir,
int flags,
void * data )

Mounts devpts on a directory: its one root directory is bound there.

Parameters
dirthe directory to mount it on
flagsnot used
datanot used
Returns
0, -EINVAL if devpts wasn't set up, or a negative errno

Definition at line 65 of file devpts.c.

References devpts_mount(), devpts_root, and vfs_bind().

Referenced by devpts_mount().

Variable Documentation

◆ devpts

struct fs devpts
Initial value:
= {
.name = "devpts",
.nodev = 1,
.init = devpts_init,
.mount = devpts_mount,
}
int devpts_mount(struct vnode *dir, int flags, void *data)
Mounts devpts on a directory: its one root directory is bound there.
Definition devpts.c:65
int devpts_init()
Sets devpts up at boot: tmpfs's operations, and its root directory.
Definition devpts.c:23

Definition at line 73 of file devpts.c.

Referenced by devpts_init().

◆ devpts_root

struct vnode* devpts_root = NULL

Definition at line 16 of file devpts.c.

Referenced by devpts_init(), devpts_mount(), pts_new(), and pty_free().