blob: 4ca846f16fe52faf22b600acc209b8a126de0666 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* -*- linux-c -*- --------------------------------------------------------- *
2 *
3 * linux/include/linux/devpts_fs.h
4 *
5 * Copyright 1998-2004 H. Peter Anvin -- All Rights Reserved
6 *
7 * This file is part of the Linux kernel and is made available under
8 * the terms of the GNU General Public License, version 2, or at your
9 * option, any later version, incorporated herein by reference.
10 *
11 * ------------------------------------------------------------------------- */
12
13#ifndef _LINUX_DEVPTS_FS_H
14#define _LINUX_DEVPTS_FS_H
15
16#include <linux/errno.h>
17
18#ifdef CONFIG_UNIX98_PTYS
19
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010020int devpts_new_index(struct inode *ptmx_inode);
21void devpts_kill_index(struct inode *ptmx_inode, int idx);
22/* mknod in devpts */
Jiri Slaby162b97c2012-10-18 22:26:28 +020023struct inode *devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty);
Jiri Slaby8fcbaa22012-10-18 22:26:27 +020024/* get private structure */
25void *devpts_get_priv(struct inode *pts_inode);
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010026/* unlink */
27void devpts_pty_kill(struct tty_struct *tty);
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
29#else
30
31/* Dummy stubs in the no-pty case */
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010032static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
33static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
Jiri Slaby162b97c2012-10-18 22:26:28 +020034static inline struct inode *devpts_pty_new(struct inode *ptmx_inode,
35 struct tty_struct *tty)
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010036{
Jiri Slaby162b97c2012-10-18 22:26:28 +020037 return ERR_PTR(-EINVAL);
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010038}
Jiri Slaby8fcbaa22012-10-18 22:26:27 +020039static inline void *devpts_get_priv(struct inode *pts_inode)
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010040{
41 return NULL;
42}
43static inline void devpts_pty_kill(struct tty_struct *tty) { }
Linus Torvalds1da177e2005-04-16 15:20:36 -070044
45#endif
46
47
48#endif /* _LINUX_DEVPTS_FS_H */