Skip to content

Commit

Permalink
Clarify Fcntl PPROCADDDR and PLOADINFO modes
Browse files Browse the repository at this point in the history
Thanks to Jo Even Skarstein for reporting.

Fixes #171.
  • Loading branch information
mikrosk committed Oct 19, 2024
1 parent 1d14f08 commit f155834
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions gemdos/file/fcntl.ui
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,13 @@ In the parameter (!I)arg(!i) a pointer to the address of the
(!nolink [GEMDOS]) (!link [basepage] [BASEPAGE]) of the process opened as a file is returned. The
command is supported in MagiC from Version 3.0 onwards.

!label PPROCADDDR
(!B)PPROCADDDR (0x5001):(!b)
!label PPROCADDR
(!B)PPROCADDR (0x5001):(!b)
(!nl)
In the parameter (!I)arg(!i) a pointer to the address of the PCB
((!B)P(!b)rocess (!B)C(!b)ontrol (!B)B(!b)lock) is returned.
((!B)P(!b)rocess (!B)C(!b)ontrol (!B)B(!b)lock) is returned. If memory protection is enabled, this
memory cannot be read directly, use Fseek/Fread on the open process file. This is to prevent manipulation
of process' rgid/ruid/egid/euid fields to e.g. become the root.

!label PCTXTSIZE
(!B)PCTXTSIZE (0x5003):(!b)
Expand Down Expand Up @@ -474,8 +476,12 @@ present.
!label PLOADINFO
(!B)PLOADINFO (0x500c):(!b)
(!nl)
This command returns in (!I)arg(!i) a pointer to the ploadinfo structure, in
which the program name and command line are stored.
(!I)arg(!i) is a pointer to the ploadinfo structure. (!I)fnamelen(!i) must contain
the length of (!I)fname(!i) buffer in bytes and both (!I)cmdlin(!i) and (!I)fname(!i)
must be preallocated (the former to at least 128 bytes and the latter to at least
(!I)fnamelen(!i) bytes). Processes' command line will be copied into (!I)cmdlin(!i).
The complete path and filename of the process' parent will be copied into (!I)fname(!i).
If the buffer is too short the call will return EBADARG.

!label PFSTAT
(!B)PFSTAT (0x500d):(!b)
Expand Down Expand Up @@ -1128,8 +1134,8 @@ Im Parameter (!I)arg(!i) wird ein Zeiger auf die Adresse der (!link [Basepage] [
als Datei ge”ffneten Prozesses zurckgegeben. Das Kommando wird in MagiC ab
Version 3.0 untersttzt.

!label PPROCADDDR
(!B)PPROCADDDR (0x5001):(!b)
!label PPROCADDR
(!B)PPROCADDR (0x5001):(!b)
(!nl)
Im Parameter (!I)arg(!i) wird ein Zeiger auf die Adresse des PCB
(Prozess-Control-Blocks) zurckgegeben.
Expand Down

0 comments on commit f155834

Please sign in to comment.