UnixOperatingSystem.st
changeset 6987 10a0dd0ac8c9
parent 6960 f53bba609580
child 6992 8ed0883dff8f
equal deleted inserted replaced
6986:d2ef4d62861e 6987:10a0dd0ac8c9
  6410     }
  6410     }
  6411 #   define NO_PTY_TEMPL
  6411 #   define NO_PTY_TEMPL
  6412 #endif /* IRIX5 */
  6412 #endif /* IRIX5 */
  6413 
  6413 
  6414 
  6414 
       
  6415 #ifdef SYSV4
       
  6416     int _fdM, _fdS, ttygid;
       
  6417     char *line;
       
  6418 #   include <grp.h>
       
  6419     struct group *gr;
       
  6420 
       
  6421     if ((gr = getgrnam("tty")) != NULL)
       
  6422         ttygid = gr->gr_gid;
       
  6423     else
       
  6424         ttygid = -1;
       
  6425 
       
  6426     _fdM = open("/dev/ptmx", O_RDWR /* |O_NDELAY */ );
       
  6427 
       
  6428     if (_fdM >= 0) {
       
  6429         grantpt(_fdM);
       
  6430         unlockpt(_fdM);
       
  6431         line = ptsname(_fdM);
       
  6432 
       
  6433         if (line != NULL) {
       
  6434             _fdS = open(line, O_RDWR);
       
  6435             if (_fdS < 0) {
       
  6436                 (void)close(_fdM);
       
  6437                 _fdS = _fdM = -1;
       
  6438             } else {
       
  6439                 (void) chown( line, getuid(), ttygid );
       
  6440                 (void) chmod( line, S_IRUSR|S_IWUSR|S_IWGRP );
       
  6441             }
       
  6442         } else {
       
  6443             (void)close(_fdM);
       
  6444             _fdS = _fdM = -1;
       
  6445         }
       
  6446     }
       
  6447 
       
  6448     if ((_fdM >= 0) && (_fdS >= 0)) {
       
  6449          fdM = __MKSMALLINT(_fdM);
       
  6450          fdS = __MKSMALLINT(_fdS);
       
  6451     }
       
  6452 #   define NO_PTY_TEMPL
       
  6453 #endif /* SYSV4 */
       
  6454 
       
  6455 
  6415 #ifdef LINUX
  6456 #ifdef LINUX
  6416 #   define PTY_TEMPL    "/dev/ptyXX"
  6457 #   define PTY_TEMPL    "/dev/ptyXX"
  6417 #   define PT_INDEX      5
  6458 #   define PT_INDEX      5
  6418 #   define PTY_1_CHARS  "pqrstuabcdevwxyz"
  6459 #   define PTY_1_CHARS  "pqrstuabcdevwxyz"
  6419 #   define PTY_2_CHARS  "0123456789abcdef"
  6460 #   define PTY_2_CHARS  "0123456789abcdef"
 10505 ! !
 10546 ! !
 10506 
 10547 
 10507 !UnixOperatingSystem::FilePointerHandle class methodsFor:'documentation'!
 10548 !UnixOperatingSystem::FilePointerHandle class methodsFor:'documentation'!
 10508 
 10549 
 10509 version
 10550 version
 10510     ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.134 2003-01-23 11:52:19 cg Exp $'
 10551     ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.135 2003-01-31 09:27:32 penk Exp $'
 10511 ! !
 10552 ! !
 10512 
 10553 
 10513 !UnixOperatingSystem::FilePointerHandle methodsFor:'release'!
 10554 !UnixOperatingSystem::FilePointerHandle methodsFor:'release'!
 10514 
 10555 
 10515 closeFile
 10556 closeFile
 12173 ! !
 12214 ! !
 12174 
 12215 
 12175 !UnixOperatingSystem class methodsFor:'documentation'!
 12216 !UnixOperatingSystem class methodsFor:'documentation'!
 12176 
 12217 
 12177 version
 12218 version
 12178     ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.134 2003-01-23 11:52:19 cg Exp $'
 12219     ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.135 2003-01-31 09:27:32 penk Exp $'
 12179 ! !
 12220 ! !
 12180 
 12221 
 12181 UnixOperatingSystem initialize!
 12222 UnixOperatingSystem initialize!
 12182 UnixOperatingSystem::FileDescriptorHandle initialize!
 12223 UnixOperatingSystem::FileDescriptorHandle initialize!