1/* -*- linux-c -*- --------------------------------------------------------- *
2 *
3 * linux/include/linux/devpts_fs.h
4 *
5 *  Copyright 1998 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/*
14 * Prototypes for the pty driver <-> devpts filesystem interface.  Most
15 * of this is really just a hack so we can exclude it or build it as a
16 * module, and probably should go away eventually.
17 */
18
19#ifndef _LINUX_DEVPTS_FS_H
20#define _LINUX_DEVPTS_FS_H 1
21
22#include <linux/config.h>
23#include <linux/kdev_t.h>
24#include <linux/tty.h>
25
26#ifdef CONFIG_DEVPTS_FS
27
28void devpts_pty_new(int, kdev_t);
29void devpts_pty_kill(int);
30#define unix98_max_ptys               NR_PTYS * UNIX98_NR_MAJORS;
31
32#elif defined(CONFIG_DEVPTS_FS_MODULE)
33
34#ifdef BUILDING_PTY_C
35void (*devpts_upcall_new)(int,kdev_t) = NULL;
36void (*devpts_upcall_kill)(int)       = NULL;
37unsigned int unix98_max_ptys          = NR_PTYS * UNIX98_NR_MAJORS;
38
39EXPORT_SYMBOL(devpts_upcall_new);
40EXPORT_SYMBOL(devpts_upcall_kill);
41EXPORT_SYMBOL(unix98_max_ptys);
42#else
43extern void (*devpts_upcall_new)(int,kdev_t);
44extern void (*devpts_upcall_kill)(int);
45extern unsigned int unix98_max_ptys;
46#endif
47
48#ifndef BUILDING_DEVPTS
49static inline void
50devpts_pty_new(int line, kdev_t device)
51{
52	if ( devpts_upcall_new )
53		return devpts_upcall_new(line,device);
54}
55
56static inline void
57devpts_pty_kill(int line)
58{
59	if ( devpts_upcall_kill )
60		return devpts_upcall_kill(line);
61}
62#endif
63
64#else  /* No /dev/pts filesystem at all */
65
66static inline void
67devpts_pty_new(int line, kdev_t device) { }
68
69static inline void
70devpts_pty_kill(int line) { }
71
72#endif
73
74#endif /* _LINUX_DEVPTS_FS_H */
75