Print this page
104 Bring back lx brand


 109 extern void ptms_init(void);
 110 extern struct pt_ttys *pt_ttys_alloc(void);
 111 extern void ptms_close(struct pt_ttys *, uint_t);
 112 extern struct pt_ttys *ptms_minor2ptty(minor_t);
 113 extern int ptms_attach_slave(void);
 114 extern int ptms_minor_valid(minor_t ptmin, uid_t *uid, gid_t *gid);
 115 extern int ptms_minor_exists(minor_t ptmin);
 116 extern void ptms_set_owner(minor_t ptmin, uid_t uid, gid_t gid);
 117 extern major_t ptms_slave_attached(void);
 118 
 119 #ifdef DEBUG
 120 extern void ptms_log(char *, uint_t);
 121 extern void ptms_logp(char *, uintptr_t);
 122 #define DDBG(a, b) ptms_log(a, b)
 123 #define DDBGP(a, b) ptms_logp(a, b)
 124 #else
 125 #define DDBG(a, b)
 126 #define DDBGP(a, b)
 127 #endif
 128 






 129 #endif /* _KERNEL */
 130 
 131 typedef struct pt_own {
 132         uid_t   pto_ruid;
 133         gid_t   pto_rgid;
 134 } pt_own_t;
 135 
 136 /*
 137  * ioctl commands
 138  *
 139  *  ISPTM: Determines whether the file descriptor is that of an open master
 140  *         device. Return code of zero indicates that the file descriptor
 141  *         represents master device.
 142  *
 143  * UNLKPT: Unlocks the master and slave devices.  It returns 0 on success. On
 144  *         failure, the errno is set to EINVAL indicating that the master
 145  *         device is not open.
 146  *
 147  *  ZONEPT: Sets the zoneid of the pair of master and slave devices.  It
 148  *          returns 0 upon success.  Used to force a pty 'into' a zone upon
 149  *          zone entry.
 150  *
 151  * PT_OWNER: Sets uid and gid for slave device.  It returns 0 on success.
 152  *
 153  */
 154 #define ISPTM           (('P'<<8)|1)      /* query for master */
 155 #define UNLKPT          (('P'<<8)|2)      /* unlock master/slave pair */
 156 #define PTSSTTY         (('P'<<8)|3)      /* set tty flag */
 157 #define ZONEPT          (('P'<<8)|4)      /* set zone of master/slave pair */
 158 #define OWNERPT         (('P'<<8)|5)      /* set owner/group for slave device */
 159 













 160 #ifdef  __cplusplus
 161 }
 162 #endif
 163 
 164 #endif  /* _SYS_PTMS_H */


 109 extern void ptms_init(void);
 110 extern struct pt_ttys *pt_ttys_alloc(void);
 111 extern void ptms_close(struct pt_ttys *, uint_t);
 112 extern struct pt_ttys *ptms_minor2ptty(minor_t);
 113 extern int ptms_attach_slave(void);
 114 extern int ptms_minor_valid(minor_t ptmin, uid_t *uid, gid_t *gid);
 115 extern int ptms_minor_exists(minor_t ptmin);
 116 extern void ptms_set_owner(minor_t ptmin, uid_t uid, gid_t gid);
 117 extern major_t ptms_slave_attached(void);
 118 
 119 #ifdef DEBUG
 120 extern void ptms_log(char *, uint_t);
 121 extern void ptms_logp(char *, uintptr_t);
 122 #define DDBG(a, b) ptms_log(a, b)
 123 #define DDBGP(a, b) ptms_logp(a, b)
 124 #else
 125 #define DDBG(a, b)
 126 #define DDBGP(a, b)
 127 #endif
 128 
 129 typedef struct __ptmptsopencb_arg *ptmptsopencb_arg_t;
 130 typedef struct ptmptsopencb {
 131         boolean_t               (*ppocb_func)(ptmptsopencb_arg_t);
 132         ptmptsopencb_arg_t      ppocb_arg;
 133 } ptmptsopencb_t;
 134 
 135 #endif /* _KERNEL */
 136 
 137 typedef struct pt_own {
 138         uid_t   pto_ruid;
 139         gid_t   pto_rgid;
 140 } pt_own_t;
 141 
 142 /*
 143  * ioctl commands
 144  *
 145  *  ISPTM: Determines whether the file descriptor is that of an open master
 146  *         device. Return code of zero indicates that the file descriptor
 147  *         represents master device.
 148  *
 149  * UNLKPT: Unlocks the master and slave devices.  It returns 0 on success. On
 150  *         failure, the errno is set to EINVAL indicating that the master
 151  *         device is not open.
 152  *
 153  *  ZONEPT: Sets the zoneid of the pair of master and slave devices.  It
 154  *          returns 0 upon success.  Used to force a pty 'into' a zone upon
 155  *          zone entry.
 156  *
 157  * PT_OWNER: Sets uid and gid for slave device.  It returns 0 on success.
 158  *
 159  */
 160 #define ISPTM           (('P'<<8)|1)      /* query for master */
 161 #define UNLKPT          (('P'<<8)|2)      /* unlock master/slave pair */
 162 #define PTSSTTY         (('P'<<8)|3)      /* set tty flag */
 163 #define ZONEPT          (('P'<<8)|4)      /* set zone of master/slave pair */
 164 #define OWNERPT         (('P'<<8)|5)      /* set owner/group for slave device */
 165 
 166 #ifdef _KERNEL
 167 /*
 168  * kernel ioctl commands
 169  *
 170  * PTMPTSOPENCB: Returns a callback function pointer and opaque argument.
 171  *            The return value of the callback function when it's invoked
 172  *            with the opaque argument passed to it will indicate if the
 173  *            pts slave device is currently open.
 174  */
 175 #define PTMPTSOPENCB    (('P'<<8)|6)      /* check if the slave is open */
 176 
 177 #endif /* _KERNEL */
 178 
 179 #ifdef  __cplusplus
 180 }
 181 #endif
 182 
 183 #endif  /* _SYS_PTMS_H */