From: mutazilah@gmail.com   
      
   On 23/02/24 18:25, Richard Kettlewell wrote:   
   > Paul Edwards writes:   
   >>> No need to mess with the behavior read() and write().   
   >>   
   >> No need to mess with the behavior of read() and write() on WHICH   
   >> SYSTEM?   
   >   
   > Any system.   
      
   There is a need, or at least, desire, to mess   
   with the behavior of read and write on PDOS/386,   
   for the exact same reason that Cygwin does.   
      
   It has no impact on anyone else.   
      
   >>> But I think we’ve been round that loop and for unknown reasons you   
   >>> still seem to want to do it the hard way.   
   >>   
   >> I don't consider this to be the hard way.   
   >>   
   >> Can you suggest a syscall that I could use to detect   
   >> whether I am running under true Linux or PDOS/386   
   >> so that I can get the C library to adjust appropriately?   
   >   
   > uname()   
      
   Thanks. I've just tested that (syscall 122).   
      
   root@kerravon2-pc:/home/kerravon/w2kshare# ./pdptest.exe   
   welcome to pdptest   
   buf is XLinuxX   
   buf + 65 is Xkerravon2-pcX   
   buf + 65 * 2 is X6.5.0-18-genericX   
   buf + 65 * 3 is X#18~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 7   
   11:40:03 UTC 2X   
   buf + 65 * 4 is Xx86_64X   
   buf + 65 * 5 is X(none)X   
   m1 is 00000000   
      
   It looks to me like I need a buffer of size 6 * 65,   
   but I can add another 200 bytes and hope that is   
   enough.   
      
   It's not ideal, but it'll probably be sufficient.   
      
   And perhaps I could fudge this call so that on   
   PDOS/386 it returns 0x1234 as a magic number   
   instead of 0, so that I know it is PDOS/386.   
      
   That way I don't need to do a strcmp to a   
   particular system name. As I guess ultimately   
   I am trying to develop an alternative to POSIX.   
   So this could indicate that the alternative is   
   in effect.   
      
   And then if I am on a PDOS/386 (or POSIX-alternate)   
   system when I am opening a text file I can include a   
   flag of 0x8000 0000 to the open syscall.   
      
   > From another posting:   
   >   
   >> Specifically ones linked with PDPCLIB where I have   
   >> done very specific things (which I control) so that   
   >> THE BINARIES work on BOTH Linux and PDOS/386.   
   >   
   > Do you get that this is a weird requirement? You could just compile your   
   > code twice, one for Linux and once for your toy platform.   
      
   Sure - in fact I could just use the Win32 binaries.   
      
   But if I have to do that, I can no longer advertise   
   it as a "mini-Linux clone" that runs "properly-built"   
   Linux executables.   
      
   Where "properly-built" is something I just make up now   
   and roughly means "supports both POSIX and POSIX-alternate   
   systems".   
      
   BFN. Paul.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|