blob: 45f746a48dcd389a81c752885660a0fffa037a83 [file] [log] [blame]
Thomas Gleixnerd6910052019-05-22 09:51:29 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/* -*- linux-c -*- --------------------------------------------------------- *
3 *
4 * linux/include/linux/devpts_fs.h
5 *
6 * Copyright 1998-2004 H. Peter Anvin -- All Rights Reserved
7 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 * ------------------------------------------------------------------------- */
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
Eric W. Biedermaneedf2652016-06-02 10:29:47 -050017struct pts_fs_info;
18
Eric W. Biederman311fc652017-08-24 15:13:29 -050019struct vfsmount *devpts_mntget(struct file *, struct pts_fs_info *);
Linus Torvalds143c97c2017-08-23 18:16:11 -070020struct pts_fs_info *devpts_acquire(struct file *);
Eric W. Biedermaneedf2652016-06-02 10:29:47 -050021void devpts_release(struct pts_fs_info *);
Linus Torvalds67245ff2016-04-16 15:16:07 -070022
23int devpts_new_index(struct pts_fs_info *);
24void devpts_kill_index(struct pts_fs_info *, int);
25
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010026/* mknod in devpts */
Linus Torvalds8ead9dd2016-04-25 20:04:08 -070027struct dentry *devpts_pty_new(struct pts_fs_info *, int, void *);
Jiri Slaby8fcbaa2b2012-10-18 22:26:27 +020028/* get private structure */
Linus Torvalds8ead9dd2016-04-25 20:04:08 -070029void *devpts_get_priv(struct dentry *);
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010030/* unlink */
Linus Torvalds8ead9dd2016-04-25 20:04:08 -070031void devpts_pty_kill(struct dentry *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Eric W. Biederman311fc652017-08-24 15:13:29 -050033/* in pty.c */
34int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags);
35
36#else
37static inline int
38ptm_open_peer(struct file *master, struct tty_struct *tty, int flags)
39{
40 return -EIO;
41}
Linus Torvalds1da177e2005-04-16 15:20:36 -070042#endif
43
44
45#endif /* _LINUX_DEVPTS_FS_H */