Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
Sukadev Bhattiprolu | 15f1a63 | 2008-10-13 10:42:59 +0100 | [diff] [blame] | 20 | int devpts_new_index(struct inode *ptmx_inode); |
| 21 | void devpts_kill_index(struct inode *ptmx_inode, int idx); |
| 22 | /* mknod in devpts */ |
Jiri Slaby | f11afb6 | 2012-10-18 22:26:29 +0200 | [diff] [blame] | 23 | struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index, |
| 24 | void *priv); |
Jiri Slaby | 8fcbaa2 | 2012-10-18 22:26:27 +0200 | [diff] [blame] | 25 | /* get private structure */ |
| 26 | void *devpts_get_priv(struct inode *pts_inode); |
Sukadev Bhattiprolu | 15f1a63 | 2008-10-13 10:42:59 +0100 | [diff] [blame] | 27 | /* unlink */ |
Jiri Slaby | f11afb6 | 2012-10-18 22:26:29 +0200 | [diff] [blame] | 28 | void devpts_pty_kill(struct inode *inode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
| 30 | #else |
| 31 | |
| 32 | /* Dummy stubs in the no-pty case */ |
Sukadev Bhattiprolu | 15f1a63 | 2008-10-13 10:42:59 +0100 | [diff] [blame] | 33 | static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } |
| 34 | static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } |
Jiri Slaby | 162b97c | 2012-10-18 22:26:28 +0200 | [diff] [blame] | 35 | static inline struct inode *devpts_pty_new(struct inode *ptmx_inode, |
Jiri Slaby | f11afb6 | 2012-10-18 22:26:29 +0200 | [diff] [blame] | 36 | dev_t device, int index, void *priv) |
Sukadev Bhattiprolu | 15f1a63 | 2008-10-13 10:42:59 +0100 | [diff] [blame] | 37 | { |
Jiri Slaby | 162b97c | 2012-10-18 22:26:28 +0200 | [diff] [blame] | 38 | return ERR_PTR(-EINVAL); |
Sukadev Bhattiprolu | 15f1a63 | 2008-10-13 10:42:59 +0100 | [diff] [blame] | 39 | } |
Jiri Slaby | 8fcbaa2 | 2012-10-18 22:26:27 +0200 | [diff] [blame] | 40 | static inline void *devpts_get_priv(struct inode *pts_inode) |
Sukadev Bhattiprolu | 15f1a63 | 2008-10-13 10:42:59 +0100 | [diff] [blame] | 41 | { |
| 42 | return NULL; |
| 43 | } |
Jiri Slaby | f11afb6 | 2012-10-18 22:26:29 +0200 | [diff] [blame] | 44 | static inline void devpts_pty_kill(struct inode *inode) { } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
| 46 | #endif |
| 47 | |
| 48 | |
| 49 | #endif /* _LINUX_DEVPTS_FS_H */ |