devpts_fs.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #ifndef _LINUX_DEVPTS_FS_H
  13. #define _LINUX_DEVPTS_FS_H
  14. #include <linux/errno.h>
  15. #ifdef CONFIG_UNIX98_PTYS
  16. int devpts_new_index(struct inode *ptmx_inode);
  17. void devpts_kill_index(struct inode *ptmx_inode, int idx);
  18. /* mknod in devpts */
  19. int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty);
  20. /* get private structure */
  21. void *devpts_get_priv(struct inode *pts_inode);
  22. /* unlink */
  23. void devpts_pty_kill(struct tty_struct *tty);
  24. #else
  25. /* Dummy stubs in the no-pty case */
  26. static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
  27. static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
  28. static inline int devpts_pty_new(struct inode *ptmx_inode,
  29. struct tty_struct *tty)
  30. {
  31. return -EINVAL;
  32. }
  33. static inline void *devpts_get_priv(struct inode *pts_inode)
  34. {
  35. return NULL;
  36. }
  37. static inline void devpts_pty_kill(struct tty_struct *tty) { }
  38. #endif
  39. #endif /* _LINUX_DEVPTS_FS_H */