From: Evenbit on
On Apr 12, 3:35 pm, "r...(a)cs.ucr.edu" <r...(a)cs.ucr.edu> wrote:
> > stdout.puts( " " );
> > conv.bToStr( cl, 2, ' ', s ); // in StdLib 2.0 use byteToHex()
>
> Actually, that would be conv.h8ToStr :-)

Yeah, I looked at the wrong docs. The machine gets more disorganized
as the days progress. Probably best to erase the drive and start
over. ;)

Speaking of mess (locally and on the net), I have been looking all
over but still can't find the all the magic numbers I need to make
Linux sys-calls. Does anyone know the value for the 'flags' argument
to 'sys_open' when you want it read only? I know that sys_open is 5.

Nathan.

From: Evenbit on
On Apr 12, 11:45 pm, "Evenbit" <nbaker2...(a)charter.net> wrote:
>
> Speaking of mess (locally and on the net), I have been looking all
> over but still can't find the all the magic numbers I need to make
> Linux sys-calls. Does anyone know the value for the 'flags' argument
> to 'sys_open' when you want it read only? I know that sys_open is 5.

Nevermind -- I found it! Jeff Owen to my rescue...

; file_open - open named file
; INPUTS
; ebx = ptr to full file path
; ecx = access flags
; O_RDONLY 00
; O_WRONLY 01
; O_RDWR 02
;
; O_CREAT 0100
; O_EXCL 0200
; O_NOCTTY 0400
; O_TRUNC 01000
; O_APPEND 02000
; O_NONBLOCK 04000
; O_NDELAY O_NONBLOCK
; O_SYNC 010000 specific to ext2 fs and block devices
; FASYNC 020000 fcntl, for BSD compatibility
; O_DIRECT 040000 direct disk access hint-currently
ignored
; O_LARGEFILE 0100000
; O_DIRECTORY 0200000 must be a directory
; O_NOFOLLOW 0400000 don't follow links;
;
; edx = permissions used if file created
; S_ISUID 04000 set user ID on execution
; S_ISGID 02000 set group ID on execution
; S_ISVTX 01000 sticky bit
; S_IRUSR 00400 read by owner(S_IREAD)
; S_IWUSR 00200 write by owner(S_IWRITE)
; S_IXUSR 00100 execute/search by owner(S_IEXEC)
; S_IRGRP 00040 read by group
; S_IWGRP 00020 write by group
; S_IXGRP 00010 execute/search by group
; S_IROTH 00004 read by others
; S_IWOTH 00002 write by others
; S_IXOTH 00001 execute/search by others
; OUTPUT
; eax = negative if error (error number)
; eax = positive file handle if success
; flags are set for js jns jump

Nathan.

From: Charles Crayne on
On 12 Apr 2007 20:45:15 -0700
"Evenbit" <nbaker2328(a)charter.net> wrote:

> I know that sys_open is 5.

Yes, in 32-bit mode, but they renumbered all the sys calls for 64-bit
mode, so, to plan for the future, you should use an include file, rather
than code the actual numbers.

-- Chuck
From: Frank Kotler on
Evenbit wrote:
> On Apr 12, 11:45 pm, "Evenbit" <nbaker2...(a)charter.net> wrote:
>
>>Speaking of mess (locally and on the net), I have been looking all
>>over but still can't find the all the magic numbers I need to make
>>Linux sys-calls. Does anyone know the value for the 'flags' argument
>>to 'sys_open' when you want it read only? I know that sys_open is 5.
>
>
> Nevermind -- I found it! Jeff Owen to my rescue...
>
> ; file_open - open named file
> ; INPUTS
> ; ebx = ptr to full file path
> ; ecx = access flags
> ; O_RDONLY 00
> ; O_WRONLY 01
> ; O_RDWR 02
> ;
> ; O_CREAT 0100
> ; O_EXCL 0200
> ; O_NOCTTY 0400
> ; O_TRUNC 01000
> ; O_APPEND 02000
> ; O_NONBLOCK 04000
> ; O_NDELAY O_NONBLOCK
> ; O_SYNC 010000 specific to ext2 fs and block devices
> ; FASYNC 020000 fcntl, for BSD compatibility
> ; O_DIRECT 040000 direct disk access hint-currently
> ignored
> ; O_LARGEFILE 0100000
> ; O_DIRECTORY 0200000 must be a directory
> ; O_NOFOLLOW 0400000 don't follow links;
> ;
> ; edx = permissions used if file created
> ; S_ISUID 04000 set user ID on execution
> ; S_ISGID 02000 set group ID on execution
> ; S_ISVTX 01000 sticky bit
> ; S_IRUSR 00400 read by owner(S_IREAD)
> ; S_IWUSR 00200 write by owner(S_IWRITE)
> ; S_IXUSR 00100 execute/search by owner(S_IEXEC)
> ; S_IRGRP 00040 read by group
> ; S_IWGRP 00020 write by group
> ; S_IXGRP 00010 execute/search by group
> ; S_IROTH 00004 read by others
> ; S_IWOTH 00002 write by others
> ; S_IXOTH 00001 execute/search by others
> ; OUTPUT
> ; eax = negative if error (error number)
> ; eax = positive file handle if success
> ; flags are set for js jns jump

Note that those numbers are *octal* (leading 0)! I'm fairly sure HLA
knows these equates, but named in lowercase "linux.o_rdonly", etc.

Best,
Frank
From: Evenbit on
On Apr 13, 12:36 am, Charles Crayne <charles.cra...(a)crayne.org> wrote:
> On 12 Apr 2007 20:45:15 -0700
>
> "Evenbit" <nbaker2...(a)charter.net> wrote:
> > I know that sys_open is 5.
>
> Yes, in 32-bit mode, but they renumbered all the sys calls for 64-bit
> mode, so, to plan for the future, you should use an include file, rather
> than code the actual numbers.

Tell that to Frank. He's been setting a bad example here these past
couple of years. ;)

Nathan.

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8
Prev: DIV overflow
Next: RIP relative adresses