Skip to content

Commit 70785ab

Browse files
0x22
1 parent f8eb865 commit 70785ab

File tree

1 file changed

+85
-28
lines changed

1 file changed

+85
-28
lines changed

docs/source/os.rst

Lines changed: 85 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ application by translating f_stat() data.
249249

250250
ZXSTACK
251251
-------
252-
.. c:function:: void zxstack(void);
252+
.. c:function:: void zxstack (void);
253253
254254
|
255255
@@ -264,8 +264,8 @@ ZXSTACK
264264
XREG
265265
----
266266

267-
.. c:function:: int xreg(char device, char channel, unsigned char address, ...);
268-
.. c:function:: int xregn(char device, char channel, unsigned char address, unsigned count, ...);
267+
.. c:function:: int xreg (char device, char channel, unsigned char address, ...);
268+
.. c:function:: int xregn (char device, char channel, unsigned char address, unsigned count, ...);
269269
270270
|
271271
@@ -297,7 +297,7 @@ XREG
297297
PHI2
298298
----
299299

300-
.. c:function:: int phi2(void)
300+
.. c:function:: int phi2 (void)
301301
302302
|
303303
@@ -313,7 +313,7 @@ PHI2
313313
CODE_PAGE
314314
---------
315315
316-
.. c:function:: int code_page(int cp)
316+
.. c:function:: int code_page (int cp)
317317
318318
|
319319
@@ -336,7 +336,7 @@ CODE_PAGE
336336
LRAND
337337
-----
338338

339-
.. c:function:: long lrand(void)
339+
.. c:function:: long lrand (void)
340340
341341
|
342342
@@ -354,7 +354,7 @@ LRAND
354354
STDIN_OPT
355355
---------
356356
357-
.. c:function:: int stdin_opt(unsigned long ctrl_bits, unsigned char str_length)
357+
.. c:function:: int stdin_opt (unsigned long ctrl_bits, unsigned char str_length)
358358
359359
|
360360
@@ -381,7 +381,7 @@ STDIN_OPT
381381
ERRNO_OPT
382382
---------
383383
384-
.. c:function:: int errno_opt(char option)
384+
.. c:function:: int errno_opt (char option)
385385
386386
|
387387
@@ -500,7 +500,7 @@ ERRNO_OPT
500500
CLOCK
501501
-----
502502
503-
.. c:function:: unsigned long clock(void)
503+
.. c:function:: unsigned long clock (void)
504504
505505
|
506506
@@ -516,7 +516,7 @@ CLOCK
516516
CLOCK_GETRES
517517
------------
518518
519-
.. c:function:: int clock_getres(clockid_t clock_id, struct timespec *res)
519+
.. c:function:: int clock_getres (clockid_t clock_id, struct timespec *res)
520520
521521
|
522522
@@ -540,7 +540,7 @@ CLOCK_GETRES
540540
CLOCK_GETTIME
541541
-------------
542542
543-
.. c:function:: int clock_gettime(clockid_t clock_id, struct timespec *tp)
543+
.. c:function:: int clock_gettime (clockid_t clock_id, struct timespec *tp)
544544
545545
|
546546
@@ -557,7 +557,7 @@ CLOCK_GETTIME
557557
CLOCK_SETTIME
558558
-------------
559559
560-
.. c:function:: int clock_settime(clockid_t clock_id, const struct timespec *tp)
560+
.. c:function:: int clock_settime (clockid_t clock_id, const struct timespec *tp)
561561
562562
|
563563
@@ -574,7 +574,7 @@ CLOCK_SETTIME
574574
CLOCK_GETTIMEZONE
575575
-----------------
576576
577-
.. c:function:: int clock_gettimezone(uint32_t time, clockid_t clock_id, struct _timezone *tz)
577+
.. c:function:: int clock_gettimezone (uint32_t time, clockid_t clock_id, struct _timezone *tz)
578578
579579
.. code-block:: c
580580
@@ -605,7 +605,7 @@ CLOCK_GETTIMEZONE
605605
OPEN
606606
----
607607
608-
.. c:function:: int open(const char *path, int oflag)
608+
.. c:function:: int open (const char *path, int oflag)
609609
610610
|
611611
@@ -644,7 +644,7 @@ OPEN
644644
CLOSE
645645
-----
646646
647-
.. c:function:: int close(int fildes)
647+
.. c:function:: int close (int fildes)
648648
649649
|
650650
@@ -663,7 +663,7 @@ CLOSE
663663
READ
664664
----
665665
666-
.. c:function:: int read(int fildes, void *buf, unsigned count)
666+
.. c:function:: int read (int fildes, void *buf, unsigned count)
667667
668668
|
669669
@@ -685,7 +685,7 @@ READ
685685
READ_XSTACK
686686
-----------
687687
688-
.. c:function:: int read_xstack(void *buf, unsigned count, int fildes)
688+
.. c:function:: int read_xstack (void *buf, unsigned count, int fildes)
689689
690690
|
691691
@@ -705,7 +705,7 @@ READ_XSTACK
705705
READ_XRAM
706706
---------
707707
708-
.. c:function:: int read_xram(unsigned buf, unsigned count, int fildes)
708+
.. c:function:: int read_xram (unsigned buf, unsigned count, int fildes)
709709
710710
|
711711
@@ -726,7 +726,7 @@ READ_XRAM
726726
WRITE
727727
-----
728728
729-
.. c:function:: int write(int fildes, const void *buf, unsigned count)
729+
.. c:function:: int write (int fildes, const void *buf, unsigned count)
730730
731731
|
732732
@@ -748,7 +748,7 @@ WRITE
748748
WRITE_XSTACK
749749
------------
750750
751-
.. c:function:: int write_xstack(const void *buf, unsigned count, int fildes)
751+
.. c:function:: int write_xstack (const void *buf, unsigned count, int fildes)
752752
753753
|
754754
@@ -769,7 +769,7 @@ WRITE_XSTACK
769769
WRITE_XRAM
770770
----------
771771
772-
.. c:function:: int write_xram(unsigned buf, unsigned count, int fildes)
772+
.. c:function:: int write_xram (unsigned buf, unsigned count, int fildes)
773773
774774
|
775775
@@ -790,14 +790,17 @@ WRITE_XRAM
790790
LSEEK
791791
-----
792792
793-
.. c:function:: static long f_lseek(long offset, char whence, int fildes)
794-
.. c:function:: off_t lseek(int fildes, off_t offset, int whence)
793+
.. c:function:: static long f_lseek (long offset, char whence, int fildes)
794+
.. c:function:: off_t lseek (int fildes, off_t offset, int whence)
795795
796796
|
797797
798798
Move the read/write pointer. The OS uses the ABI format of f_seek().
799799
An lseek() compatible wrapper is provided with the compiler library.
800800
801+
This can also be used to obtain the current read/write position
802+
with ``f_lseek(0, SEEK_CUR, fd)``.
803+
801804
:Op code: See table below.
802805
:C proto: f_lseek: rp6502.h, lseek: unistd.h
803806
:param offset: How far you wish to seek.
@@ -833,7 +836,7 @@ LSEEK
833836
UNLINK
834837
------
835838
836-
.. c:function:: int unlink(const char* name)
839+
.. c:function:: int unlink (const char* name)
837840
838841
|
839842
@@ -852,7 +855,7 @@ UNLINK
852855
RENAME
853856
------
854857
855-
.. c:function:: int rename(const char* oldname, const char* newname)
858+
.. c:function:: int rename (const char* oldname, const char* newname)
856859
857860
|
858861
@@ -872,7 +875,7 @@ RENAME
872875
SYNCFS
873876
------
874877
875-
.. c:function:: int syncfs(int fildes)
878+
.. c:function:: int syncfs (int fildes)
876879
877880
|
878881
@@ -915,13 +918,67 @@ STAT
915918
:param dirent: Returned f_stat_t data.
916919
:returns: 0 on success. -1 on error.
917920
:a regs: return, dirent
918-
:errno: FR_DISK_ERR, FR_INT_ERR, FR_NOT_READY, FR_NO_FILE, FR_NO_PATH, FR_INVALID_NAME, FR_INVALID_DRIVE, FR_NOT_ENABLED, FR_NO_FILESYSTEM, FR_TIMEOUT, FR_NOT_ENOUGH_CORE
921+
:errno: EINVAL, FR_DISK_ERR, FR_INT_ERR, FR_NOT_READY, FR_NO_FILE, FR_NO_PATH, FR_INVALID_NAME, FR_INVALID_DRIVE, FR_NOT_ENABLED, FR_NO_FILESYSTEM, FR_TIMEOUT, FR_NOT_ENOUGH_CORE
922+
923+
924+
OPENDIR
925+
-------
926+
927+
.. c:function:: int f_opendir (const char* name)
928+
929+
|
930+
931+
Create a connection between a directory and a directory descriptor. Up to 8
932+
directories may be open at once.
933+
934+
:Op code: RIA_OP_OPENDIR 0x20
935+
:C proto: rp6502.h
936+
:param name: Pathname to a directory.
937+
:returns: Directory descriptor. -1 on error.
938+
:a regs: return
939+
:errno: EINVAL, EMFILE, FR_DISK_ERR, FR_INT_ERR, FR_NOT_READY, FR_NO_PATH, FR_INVALID_NAME, FR_INVALID_OBJECT, FR_INVALID_DRIVE, FR_NOT_ENABLED, FR_NO_FILESYSTEM, FR_TIMEOUT, FR_NOT_ENOUGH_CORE, FR_TOO_MANY_OPEN_FILES
940+
941+
942+
READDIR
943+
-------
944+
945+
.. c:function:: int f_readdir (f_stat_t* dirent, int dirdes)
946+
947+
|
948+
949+
Returns file or directory info for directory descriptor.
950+
951+
:Op code: RIA_OP_READDIR 0x21
952+
:C proto: rp6502.h
953+
:param path: Pathname to a directory entry.
954+
:param dirent: Returned f_stat_t data.
955+
:returns: 0 on success. -1 on error.
956+
:a regs: return, dirent
957+
:errno: EINVAL, FR_DISK_ERR, FR_INT_ERR, FR_INVALID_OBJECT, FR_TIMEOUT, FR_NOT_ENOUGH_CORE
958+
959+
960+
CLOSEDIR
961+
--------
962+
963+
.. c:function:: int f_closedir (int dirdes)
964+
965+
|
966+
967+
Release the directory descriptor. Directory descriptor
968+
will rejoin the pool available for use by f_opendir().
969+
970+
:Op code: RIA_OP_CLOSEDIR 0x22
971+
:C proto: rp6502.h
972+
:param dirdes: Directory descriptor from f_opendir().
973+
:returns: 0 on success. -1 on error.
974+
:a regs: return, dirdes
975+
:errno: EINVAL, FR_INT_ERR, FR_INVALID_OBJECT, FR_TIMEOUT
919976
920977
921978
EXIT
922979
----
923980
924-
.. c:function:: void exit(int status)
981+
.. c:function:: void exit (int status)
925982
926983
|
927984

0 commit comments

Comments
 (0)