devpts_fs.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 tty structure */
  21. struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number);
  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 struct tty_struct *devpts_get_tty(struct inode *pts_inode,
  34. int number)
  35. {
  36. return NULL;
  37. }
  38. static inline void devpts_pty_kill(struct tty_struct *tty) { }
  39. #endif
  40. #endif /* _LINUX_DEVPTS_FS_H */