devpts_fs.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
  20. void *priv);
  21. /* get private structure */
  22. void *devpts_get_priv(struct inode *pts_inode);
  23. /* unlink */
  24. void devpts_pty_kill(struct inode *inode);
  25. #else
  26. /* Dummy stubs in the no-pty case */
  27. static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
  28. static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
  29. static inline struct inode *devpts_pty_new(struct inode *ptmx_inode,
  30. dev_t device, int index, void *priv)
  31. {
  32. return ERR_PTR(-EINVAL);
  33. }
  34. static inline void *devpts_get_priv(struct inode *pts_inode)
  35. {
  36. return NULL;
  37. }
  38. static inline void devpts_pty_kill(struct inode *inode) { }
  39. #endif
  40. #endif /* _LINUX_DEVPTS_FS_H */