UnixOperatingSystem.st
changeset 7185 0a3ba41f0d31
parent 7175 e3bba0479a52
child 7198 62450598d208
equal deleted inserted replaced
7184:1191a63dcd26 7185:0a3ba41f0d31
  9825 
  9825 
  9826     |desc|
  9826     |desc|
  9827 
  9827 
  9828     desc := fd.
  9828     desc := fd.
  9829     self invalidate.
  9829     self invalidate.
  9830 
  9830 'close ' errorPrint. desc errorPrintCR.
  9831     ^ OperatingSystem closeFd:desc.
  9831     ^ OperatingSystem closeFd:desc.
  9832 
  9832 
  9833     "Modified: 30.9.1997 / 13:06:55 / stefan"
  9833     "Modified: 30.9.1997 / 13:06:55 / stefan"
  9834 ! !
  9834 ! !
  9835 
  9835 
  9836 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'initialization'!
  9836 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'initialization'!
  9837 
  9837 
  9838 for:aFileDescriptor
  9838 for:aFileDescriptor
  9839     "create file for a handle"
  9839     "create a file for a handle"
  9840 
  9840 
  9841     |oldHandle|
  9841     |oldHandle|
  9842 
  9842 
  9843     fd := aFileDescriptor.
  9843     fd := aFileDescriptor.
  9844     oldHandle := OpenFiles at:aFileDescriptor.
  9844     oldHandle := OpenFiles at:aFileDescriptor.
  9845     (oldHandle notNil and:[oldHandle ~~ self]) ifTrue:[
  9845     "/ the 0 is possible, if an fd was open when saving a snapshot image,
  9846 	oldHandle invalidate.
  9846     "/ and we come up in the new image with no one referring to it.
       
  9847     (oldHandle notNil and:[oldHandle ~~ 0 and:[ oldHandle ~~ self]]) ifTrue:[
       
  9848         oldHandle invalidate.
  9847     ].
  9849     ].
  9848     self register.
  9850     self register.
  9849 
  9851 
  9850     "Created: 26.9.1997 / 17:14:40 / stefan"
  9852     "Created: 26.9.1997 / 17:14:40 / stefan"
  9851     "Modified: 30.9.1997 / 12:41:43 / stefan"
  9853     "Modified: 30.9.1997 / 12:41:43 / stefan"
 10270 
 10272 
 10271 
 10273 
 10272 ! !
 10274 ! !
 10273 
 10275 
 10274 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'private accessing'!
 10276 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'private accessing'!
       
 10277 
       
 10278 fileDescriptor
       
 10279     "return the (integer) fileDescriptor"
       
 10280 
       
 10281 %{
       
 10282     INT handle = (INT)(__externalAddressVal(self));
       
 10283 
       
 10284     if (__isSmallInteger(handle)) {
       
 10285         RETURN (handle);
       
 10286     }
       
 10287 %}.
       
 10288     ^ nil
       
 10289 !
 10275 
 10290 
 10276 setFileDescriptor:anInteger
 10291 setFileDescriptor:anInteger
 10277 
 10292 
 10278 %{
 10293 %{
 10279     if (__isSmallInteger(anInteger)) {
 10294     if (__isSmallInteger(anInteger)) {
 12771 ! !
 12786 ! !
 12772 
 12787 
 12773 !UnixOperatingSystem class methodsFor:'documentation'!
 12788 !UnixOperatingSystem class methodsFor:'documentation'!
 12774 
 12789 
 12775 version
 12790 version
 12776     ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.155 2003-04-07 18:05:54 stefan Exp $'
 12791     ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.156 2003-04-10 11:03:26 penk Exp $'
 12777 ! !
 12792 ! !
 12778 
 12793 
 12779 UnixOperatingSystem initialize!
 12794 UnixOperatingSystem initialize!
 12780 UnixOperatingSystem::FileDescriptorHandle initialize!
 12795 UnixOperatingSystem::FileDescriptorHandle initialize!