Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* -*- 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 | ||
15f1a633 SB |
20 | int devpts_new_index(struct inode *ptmx_inode); |
21 | void devpts_kill_index(struct inode *ptmx_inode, int idx); | |
1f55c718 HK |
22 | void devpts_add_ref(struct inode *ptmx_inode); |
23 | void devpts_del_ref(struct inode *ptmx_inode); | |
15f1a633 | 24 | /* mknod in devpts */ |
f11afb61 JS |
25 | struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, |
26 | void *priv); | |
8fcbaa2b JS |
27 | /* get private structure */ |
28 | void *devpts_get_priv(struct inode *pts_inode); | |
15f1a633 | 29 | /* unlink */ |
f11afb61 | 30 | void devpts_pty_kill(struct inode *inode); |
1da177e4 LT |
31 | |
32 | #else | |
33 | ||
34 | /* Dummy stubs in the no-pty case */ | |
15f1a633 SB |
35 | static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } |
36 | static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } | |
1f55c718 HK |
37 | static inline void devpts_add_ref(struct inode *ptmx_inode) { } |
38 | static inline void devpts_del_ref(struct inode *ptmx_inode) { } | |
162b97cf | 39 | static inline struct inode *devpts_pty_new(struct inode *ptmx_inode, |
f11afb61 | 40 | dev_t device, int index, void *priv) |
15f1a633 | 41 | { |
162b97cf | 42 | return ERR_PTR(-EINVAL); |
15f1a633 | 43 | } |
8fcbaa2b | 44 | static inline void *devpts_get_priv(struct inode *pts_inode) |
15f1a633 SB |
45 | { |
46 | return NULL; | |
47 | } | |
f11afb61 | 48 | static inline void devpts_pty_kill(struct inode *inode) { } |
1da177e4 LT |
49 | |
50 | #endif | |
51 | ||
52 | ||
53 | #endif /* _LINUX_DEVPTS_FS_H */ |