xref: /openbmc/linux/include/linux/devpts_fs.h (revision d6910058)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* -*- linux-c -*- --------------------------------------------------------- *
3  *
4  * linux/include/linux/devpts_fs.h
5  *
6  *  Copyright 1998-2004 H. Peter Anvin -- All Rights Reserved
7  *
8  * ------------------------------------------------------------------------- */
9 
10 #ifndef _LINUX_DEVPTS_FS_H
11 #define _LINUX_DEVPTS_FS_H
12 
13 #include <linux/errno.h>
14 
15 #ifdef CONFIG_UNIX98_PTYS
16 
17 struct pts_fs_info;
18 
19 struct vfsmount *devpts_mntget(struct file *, struct pts_fs_info *);
20 struct pts_fs_info *devpts_acquire(struct file *);
21 void devpts_release(struct pts_fs_info *);
22 
23 int devpts_new_index(struct pts_fs_info *);
24 void devpts_kill_index(struct pts_fs_info *, int);
25 
26 /* mknod in devpts */
27 struct dentry *devpts_pty_new(struct pts_fs_info *, int, void *);
28 /* get private structure */
29 void *devpts_get_priv(struct dentry *);
30 /* unlink */
31 void devpts_pty_kill(struct dentry *);
32 
33 /* in pty.c */
34 int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags);
35 
36 #else
37 static inline int
ptm_open_peer(struct file * master,struct tty_struct * tty,int flags)38 ptm_open_peer(struct file *master, struct tty_struct *tty, int flags)
39 {
40 	return -EIO;
41 }
42 #endif
43 
44 
45 #endif /* _LINUX_DEVPTS_FS_H */
46