blob: 251a2090a55444cec55ce4f04510b6ef83a69cfb [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 Slabyf11afb62012-10-18 22:26:29 +020023struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
24 void *priv);
Jiri Slaby8fcbaa22012-10-18 22:26:27 +020025/* get private structure */
26void *devpts_get_priv(struct inode *pts_inode);
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010027/* unlink */
Jiri Slabyf11afb62012-10-18 22:26:29 +020028void devpts_pty_kill(struct inode *inode);
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
30#else
31
32/* Dummy stubs in the no-pty case */
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010033static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
34static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
Jiri Slaby162b97c2012-10-18 22:26:28 +020035static inline struct inode *devpts_pty_new(struct inode *ptmx_inode,
Jiri Slabyf11afb62012-10-18 22:26:29 +020036 dev_t device, int index, void *priv)
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010037{
Jiri Slaby162b97c2012-10-18 22:26:28 +020038 return ERR_PTR(-EINVAL);
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010039}
Jiri Slaby8fcbaa22012-10-18 22:26:27 +020040static inline void *devpts_get_priv(struct inode *pts_inode)
Sukadev Bhattiprolu15f1a632008-10-13 10:42:59 +010041{
42 return NULL;
43}
Jiri Slabyf11afb62012-10-18 22:26:29 +020044static inline void devpts_pty_kill(struct inode *inode) { }
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
46#endif
47
48
49#endif /* _LINUX_DEVPTS_FS_H */