mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-03 12:06:05 +00:00
98 lines
1.8 KiB
Plaintext
98 lines
1.8 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*/--------------------------------------
|
||
* # GetPWUID
|
||
* ## C
|
||
* `int getpwuid(short int uid, S.PW* passwd );`
|
||
* ## ASM
|
||
* `>PUSHW passwd`
|
||
* `lda uid`
|
||
* `>SYSCALL getpwuid`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.GetPWUID sta ZPPtr1+1
|
||
>PULLW ZPPtr2
|
||
|
||
jmp K.SYSCALL.JMPX
|
||
*/--------------------------------------
|
||
* # GetPWName
|
||
* ## C
|
||
* `int getpwname(const char* name, S.PW* passwd );`
|
||
* ## ASM
|
||
* `>PUSHW passwd`
|
||
* `>LDYA name`
|
||
* `>SYSCALL getpwname`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.GetPWName >STYA TXTPTR
|
||
>PULLW ZPPtr2
|
||
|
||
jmp K.SYSCALL.JMPX
|
||
*/--------------------------------------
|
||
* # PutPW
|
||
* ## C
|
||
* `int putpw( S.PW* passwd );`
|
||
* ## ASM
|
||
* `>LDYA passwd`
|
||
* `>SYSCALL putpw`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.PutPW >STYA ZPPtr2
|
||
>STYA TXTPTR
|
||
|
||
jmp K.SYSCALL.JMPX
|
||
*--------------------------------------
|
||
K.FlushEtcPasswd
|
||
>LDYA PWD.DBSize
|
||
ldx PWD.hDB
|
||
jsr MEM.CopyToMain
|
||
bcs .9
|
||
|
||
stx .8+1
|
||
|
||
>PUSHWI PWD.FILE
|
||
>PUSHBI O.WRONLY+O.CREATE
|
||
>PUSHBI S.FI.T.TXT
|
||
>PUSHWZ Aux type
|
||
>SYSCALL2 FOpen
|
||
bcc .1
|
||
|
||
pha
|
||
jsr .8
|
||
pla
|
||
sec
|
||
.9 rts
|
||
|
||
.1 sta .7+1
|
||
|
||
>PUSHW PWD.DBSize
|
||
lda .8+1
|
||
jsr K.getmemptr
|
||
>PUSHYA
|
||
lda .7+1
|
||
>SYSCALL2 FWrite
|
||
bcc .7
|
||
|
||
pha
|
||
jsr .7
|
||
pla
|
||
|
||
sec
|
||
rts
|
||
|
||
.7 lda #$ff SELF MODIFIED
|
||
>SYSCALL2 fclose
|
||
|
||
.8 lda #$ff
|
||
jmp K.freemem SELF MODIFIED
|
||
*--------------------------------------
|
||
PWD.hDB .BS 1
|
||
PWD.DBPtr .BS 2
|
||
PWD.DBSize .BS 2
|
||
PWD.FILE .AZ "${ROOT}etc/passwd"
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE USR/SRC/SYS/KERNEL.S.PWD
|
||
LOAD USR/SRC/SYS/KERNEL.S
|
||
ASM
|