From 2cb687376e3a8daa8ac36295918d8747ef7c5bdd Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Wed, 7 May 2008 08:47:41 -0300 Subject: [PATCH] Added close, read and write system calls. --- _ldd.xml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/_ldd.xml b/_ldd.xml index 2b20507..47ebedf 100644 --- a/_ldd.xml +++ b/_ldd.xml @@ -86,4 +86,62 @@ fd = open ("/dev/ttyS0", O\_RDWR); + +close + +The close system call closes an open file. + + +int close (int fd); + + +Example: + + +close (fd); + + + + +read + +The read system call reads data from an open file into a buffer. For +devices, it reads from the device. + + +int read (int fd, char *buffer, int bsz); + + +Read returns the number of bytes written into the buffer, which may be +less than the number of bytes requested for any number of reasons. + + +Example: + + +c = read (fd, buffer, sizeof (buffer)); + + + + +write + +The write system call writes data to an open file from a buffer. For +devices, it writes to the device. + + +int write (int fd, char *buffer, int bsz); + + +Write returns the number of bytes written to the file, which may be +less than the number of bytes requested for any number of reasons. + + +Example: + + +c = write (fd, buffer, strlen (buffer)); + + + -- 2.20.1