Linux Audio

Check our new training course

Loading...
v3.15
 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
20int devpts_new_index(struct inode *ptmx_inode);
21void devpts_kill_index(struct inode *ptmx_inode, int idx);
 
 
 
 
 
 
 
22/* mknod in devpts */
23struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
24		void *priv);
25/* get private structure */
26void *devpts_get_priv(struct inode *pts_inode);
27/* unlink */
28void devpts_pty_kill(struct inode *inode);
29
30#else
 
31
32/* Dummy stubs in the no-pty case */
33static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
34static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
35static inline struct inode *devpts_pty_new(struct inode *ptmx_inode,
36		dev_t device, int index, void *priv)
37{
38	return ERR_PTR(-EINVAL);
39}
40static inline void *devpts_get_priv(struct inode *pts_inode)
41{
42	return NULL;
43}
44static inline void devpts_pty_kill(struct inode *inode) { }
45
46#endif
47
48
49#endif /* _LINUX_DEVPTS_FS_H */
v4.17
 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
20struct pts_fs_info;
21
22struct vfsmount *devpts_mntget(struct file *, struct pts_fs_info *);
23struct pts_fs_info *devpts_acquire(struct file *);
24void devpts_release(struct pts_fs_info *);
25
26int devpts_new_index(struct pts_fs_info *);
27void devpts_kill_index(struct pts_fs_info *, int);
28
29/* mknod in devpts */
30struct dentry *devpts_pty_new(struct pts_fs_info *, int, void *);
 
31/* get private structure */
32void *devpts_get_priv(struct dentry *);
33/* unlink */
34void devpts_pty_kill(struct dentry *);
35
36/* in pty.c */
37int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags);
38
39#else
40static inline int
41ptm_open_peer(struct file *master, struct tty_struct *tty, int flags)
 
 
 
 
 
 
42{
43	return -EIO;
44}
 
 
45#endif
46
47
48#endif /* _LINUX_DEVPTS_FS_H */