1 | Input and Output Primitives Manager |
---|
2 | ################################### |
---|
3 | |
---|
4 | Introduction |
---|
5 | ============ |
---|
6 | |
---|
7 | The input and output primitives manager is ... |
---|
8 | |
---|
9 | The directives provided by the input and output primitives manager are: |
---|
10 | |
---|
11 | - ``pipe`` - Create an Inter-Process Channel |
---|
12 | |
---|
13 | - ``dup`` - Duplicates an open file descriptor |
---|
14 | |
---|
15 | - ``dup2`` - Duplicates an open file descriptor |
---|
16 | |
---|
17 | - ``close`` - Closes a file |
---|
18 | |
---|
19 | - ``read`` - Reads from a file |
---|
20 | |
---|
21 | - ``write`` - Writes to a file |
---|
22 | |
---|
23 | - ``fcntl`` - Manipulates an open file descriptor |
---|
24 | |
---|
25 | - ``lseek`` - Reposition read/write file offset |
---|
26 | |
---|
27 | - ``fsync`` - Synchronize file complete in-core state with that on disk |
---|
28 | |
---|
29 | - ``fdatasync`` - Synchronize file in-core data with that on disk |
---|
30 | |
---|
31 | - ``sync`` - Schedule file system updates |
---|
32 | |
---|
33 | - ``mount`` - Mount a file system |
---|
34 | |
---|
35 | - ``unmount`` - Unmount file systems |
---|
36 | |
---|
37 | - ``readv`` - Vectored read from a file |
---|
38 | |
---|
39 | - ``writev`` - Vectored write to a file |
---|
40 | |
---|
41 | - ``aio_read`` - Asynchronous Read |
---|
42 | |
---|
43 | - ``aio_write`` - Asynchronous Write |
---|
44 | |
---|
45 | - ``lio_listio`` - List Directed I/O |
---|
46 | |
---|
47 | - ``aio_error`` - Retrieve Error Status of Asynchronous I/O Operation |
---|
48 | |
---|
49 | - ``aio_return`` - Retrieve Return Status Asynchronous I/O Operation |
---|
50 | |
---|
51 | - ``aio_cancel`` - Cancel Asynchronous I/O Request |
---|
52 | |
---|
53 | - ``aio_suspend`` - Wait for Asynchronous I/O Request |
---|
54 | |
---|
55 | - ``aio_fsync`` - Asynchronous File Synchronization |
---|
56 | |
---|
57 | Background |
---|
58 | ========== |
---|
59 | |
---|
60 | There is currently no text in this section. |
---|
61 | |
---|
62 | Operations |
---|
63 | ========== |
---|
64 | |
---|
65 | There is currently no text in this section. |
---|
66 | |
---|
67 | Directives |
---|
68 | ========== |
---|
69 | |
---|
70 | This section details the input and output primitives manager's directives. |
---|
71 | A subsection is dedicated to each of this manager's directives |
---|
72 | and describes the calling sequence, related constants, usage, |
---|
73 | and status codes. |
---|
74 | |
---|
75 | pipe - Create an Inter-Process Channel |
---|
76 | -------------------------------------- |
---|
77 | .. index:: pipe |
---|
78 | .. index:: create an inter |
---|
79 | |
---|
80 | **CALLING SEQUENCE:** |
---|
81 | |
---|
82 | .. code:: c |
---|
83 | |
---|
84 | int pipe( |
---|
85 | ); |
---|
86 | |
---|
87 | **STATUS CODES:** |
---|
88 | |
---|
89 | *E* |
---|
90 | The |
---|
91 | |
---|
92 | **DESCRIPTION:** |
---|
93 | |
---|
94 | **NOTES:** |
---|
95 | |
---|
96 | This routine is not currently supported by RTEMS but could be |
---|
97 | in a future version. |
---|
98 | |
---|
99 | dup - Duplicates an open file descriptor |
---|
100 | ---------------------------------------- |
---|
101 | .. index:: dup |
---|
102 | .. index:: duplicates an open file descriptor |
---|
103 | |
---|
104 | **CALLING SEQUENCE:** |
---|
105 | |
---|
106 | .. code:: c |
---|
107 | |
---|
108 | #include <unistd.h> |
---|
109 | int dup( |
---|
110 | int fildes |
---|
111 | ); |
---|
112 | |
---|
113 | **STATUS CODES:** |
---|
114 | |
---|
115 | *EBADF* |
---|
116 | Invalid file descriptor. |
---|
117 | |
---|
118 | *EINTR* |
---|
119 | Function was interrupted by a signal. |
---|
120 | |
---|
121 | *EMFILE* |
---|
122 | The process already has the maximum number of file descriptors open |
---|
123 | and tried to open a new one. |
---|
124 | |
---|
125 | **DESCRIPTION:** |
---|
126 | |
---|
127 | The ``dup`` function returns the lowest numbered available file |
---|
128 | descriptor. This new desciptor refers to the same open file as the |
---|
129 | original descriptor and shares any locks. |
---|
130 | |
---|
131 | **NOTES:** |
---|
132 | |
---|
133 | NONE |
---|
134 | |
---|
135 | dup2 - Duplicates an open file descriptor |
---|
136 | ----------------------------------------- |
---|
137 | .. index:: dup2 |
---|
138 | .. index:: duplicates an open file descriptor |
---|
139 | |
---|
140 | **CALLING SEQUENCE:** |
---|
141 | |
---|
142 | .. code:: c |
---|
143 | |
---|
144 | #include <unistd.h> |
---|
145 | int dup2( |
---|
146 | int fildes, |
---|
147 | int fildes2 |
---|
148 | ); |
---|
149 | |
---|
150 | **STATUS CODES:** |
---|
151 | |
---|
152 | *EBADF* |
---|
153 | Invalid file descriptor. |
---|
154 | |
---|
155 | *EINTR* |
---|
156 | Function was interrupted by a signal. |
---|
157 | |
---|
158 | *EMFILE* |
---|
159 | The process already has the maximum number of file descriptors open |
---|
160 | and tried to open a new one. |
---|
161 | |
---|
162 | **DESCRIPTION:** |
---|
163 | |
---|
164 | ``dup2`` creates a copy of the file descriptor ``oldfd``. |
---|
165 | |
---|
166 | The old and new descriptors may be used interchangeably. They share locks, file |
---|
167 | position pointers and flags; for example, if the file position is modified by using``lseek`` on one of the descriptors, the position is also changed for the other. |
---|
168 | |
---|
169 | **NOTES:** |
---|
170 | |
---|
171 | NONE |
---|
172 | |
---|
173 | close - Closes a file |
---|
174 | --------------------- |
---|
175 | .. index:: close |
---|
176 | .. index:: closes a file. |
---|
177 | |
---|
178 | **CALLING SEQUENCE:** |
---|
179 | |
---|
180 | .. code:: c |
---|
181 | |
---|
182 | #include <unistd.h> |
---|
183 | int close( |
---|
184 | int fildes |
---|
185 | ); |
---|
186 | |
---|
187 | **STATUS CODES:** |
---|
188 | |
---|
189 | *EBADF* |
---|
190 | Invalid file descriptor |
---|
191 | |
---|
192 | *EINTR* |
---|
193 | Function was interrupted by a signal. |
---|
194 | |
---|
195 | **DESCRIPTION:** |
---|
196 | |
---|
197 | The ``close()`` function deallocates the file descriptor named by``fildes`` and makes it available for reuse. All outstanding |
---|
198 | record locks owned by this process for the file are unlocked. |
---|
199 | |
---|
200 | **NOTES:** |
---|
201 | |
---|
202 | A signal can interrupt the ``close()`` function. In that case,``close()`` returns -1 with ``errno`` set to EINTR. The file |
---|
203 | may or may not be closed. |
---|
204 | |
---|
205 | read - Reads from a file |
---|
206 | ------------------------ |
---|
207 | .. index:: read |
---|
208 | .. index:: reads from a file |
---|
209 | |
---|
210 | **CALLING SEQUENCE:** |
---|
211 | |
---|
212 | .. code:: c |
---|
213 | |
---|
214 | #include <unistd.h> |
---|
215 | int read( |
---|
216 | int fildes, |
---|
217 | void \*buf, |
---|
218 | unsigned int nbyte |
---|
219 | ); |
---|
220 | |
---|
221 | **STATUS CODES:** |
---|
222 | |
---|
223 | On error, this routine returns -1 and sets ``errno`` to one of |
---|
224 | the following: |
---|
225 | |
---|
226 | *EAGAIN* |
---|
227 | The O_NONBLOCK flag is set for a file descriptor and the process |
---|
228 | would be delayed in the I/O operation. |
---|
229 | |
---|
230 | *EBADF* |
---|
231 | Invalid file descriptor |
---|
232 | |
---|
233 | *EINTR* |
---|
234 | Function was interrupted by a signal. |
---|
235 | |
---|
236 | *EIO* |
---|
237 | Input or output error |
---|
238 | |
---|
239 | *EINVAL* |
---|
240 | Bad buffer pointer |
---|
241 | |
---|
242 | **DESCRIPTION:** |
---|
243 | |
---|
244 | The ``read()`` function reads ``nbyte`` bytes from the file |
---|
245 | associated with ``fildes`` into the buffer pointed to by ``buf``. |
---|
246 | |
---|
247 | The ``read()`` function returns the number of bytes actually read |
---|
248 | and placed in the buffer. This will be less than ``nbyte`` if: |
---|
249 | |
---|
250 | - The number of bytes left in the file is less than ``nbyte``. |
---|
251 | |
---|
252 | - The ``read()`` request was interrupted by a signal. |
---|
253 | |
---|
254 | - The file is a pipe or FIFO or special file with less than ``nbytes`` |
---|
255 | immediately available for reading. |
---|
256 | |
---|
257 | When attempting to read from any empty pipe or FIFO: |
---|
258 | |
---|
259 | - If no process has the pipe open for writing, zero is returned to |
---|
260 | indicate end-of-file. |
---|
261 | |
---|
262 | - If some process has the pipe open for writing and O_NONBLOCK is set, |
---|
263 | -1 is returned and ``errno`` is set to EAGAIN. |
---|
264 | |
---|
265 | - If some process has the pipe open for writing and O_NONBLOCK is clear,``read()`` waits for some data to be written or the pipe to be closed. |
---|
266 | |
---|
267 | When attempting to read from a file other than a pipe or FIFO and no data |
---|
268 | is available. |
---|
269 | |
---|
270 | - If O_NONBLOCK is set, -1 is returned and ``errno`` is set to EAGAIN. |
---|
271 | |
---|
272 | - If O_NONBLOCK is clear, ``read()`` waits for some data to become |
---|
273 | available. |
---|
274 | |
---|
275 | - The O_NONBLOCK flag is ignored if data is available. |
---|
276 | |
---|
277 | **NOTES:** |
---|
278 | |
---|
279 | NONE |
---|
280 | |
---|
281 | write - Writes to a file |
---|
282 | ------------------------ |
---|
283 | .. index:: write |
---|
284 | .. index:: writes to a file |
---|
285 | |
---|
286 | **CALLING SEQUENCE:** |
---|
287 | |
---|
288 | .. code:: c |
---|
289 | |
---|
290 | #include <unistd.h> |
---|
291 | int write( |
---|
292 | int fildes, |
---|
293 | const void \*buf, |
---|
294 | unsigned int nbytes |
---|
295 | ); |
---|
296 | |
---|
297 | **STATUS CODES:** |
---|
298 | |
---|
299 | *EAGAIN* |
---|
300 | The O_NONBLOCK flag is set for a file descriptor and the process |
---|
301 | would be delayed in the I/O operation. |
---|
302 | |
---|
303 | *EBADF* |
---|
304 | Invalid file descriptor |
---|
305 | |
---|
306 | *EFBIG* |
---|
307 | An attempt was made to write to a file that exceeds the maximum file |
---|
308 | size |
---|
309 | |
---|
310 | *EINTR* |
---|
311 | The function was interrupted by a signal. |
---|
312 | |
---|
313 | *EIO* |
---|
314 | Input or output error. |
---|
315 | |
---|
316 | *ENOSPC* |
---|
317 | No space left on disk. |
---|
318 | |
---|
319 | *EPIPE* |
---|
320 | Attempt to write to a pope or FIFO with no reader. |
---|
321 | |
---|
322 | *EINVAL* |
---|
323 | Bad buffer pointer |
---|
324 | |
---|
325 | **DESCRIPTION:** |
---|
326 | |
---|
327 | The ``write()`` function writes ``nbyte`` from the array pointed |
---|
328 | to by ``buf`` into the file associated with ``fildes``. |
---|
329 | |
---|
330 | If ``nybte`` is zero and the file is a regular file, the ``write()`` |
---|
331 | function returns zero and has no other effect. If ``nbyte`` is zero |
---|
332 | and the file is a special file, te results are not portable. |
---|
333 | |
---|
334 | The ``write()`` function returns the number of bytes written. This |
---|
335 | number will be less than ``nbytes`` if there is an error. It will never |
---|
336 | be greater than ``nbytes``. |
---|
337 | |
---|
338 | **NOTES:** |
---|
339 | |
---|
340 | NONE |
---|
341 | |
---|
342 | fcntl - Manipulates an open file descriptor |
---|
343 | ------------------------------------------- |
---|
344 | .. index:: fcntl |
---|
345 | .. index:: manipulates an open file descriptor |
---|
346 | |
---|
347 | **CALLING SEQUENCE:** |
---|
348 | |
---|
349 | .. code:: c |
---|
350 | |
---|
351 | #include <sys/types.h> |
---|
352 | #include <fcntl.h> |
---|
353 | #include <unistd.h> |
---|
354 | int fcntl( |
---|
355 | int fildes, |
---|
356 | int cmd |
---|
357 | ); |
---|
358 | |
---|
359 | **STATUS CODES:** |
---|
360 | |
---|
361 | *EACCESS* |
---|
362 | Search permission is denied for a direcotry in a file's path |
---|
363 | prefix. |
---|
364 | |
---|
365 | *EAGAIN* |
---|
366 | The O_NONBLOCK flag is set for a file descriptor and the process |
---|
367 | would be delayed in the I/O operation. |
---|
368 | |
---|
369 | *EBADF* |
---|
370 | Invalid file descriptor |
---|
371 | |
---|
372 | *EDEADLK* |
---|
373 | An ``fcntl`` with function F_SETLKW would cause a deadlock. |
---|
374 | |
---|
375 | *EINTR* |
---|
376 | The functioin was interrupted by a signal. |
---|
377 | |
---|
378 | *EINVAL* |
---|
379 | Invalid argument |
---|
380 | |
---|
381 | *EMFILE* |
---|
382 | Too many file descriptor or in use by the process. |
---|
383 | |
---|
384 | *ENOLCK* |
---|
385 | No locks available |
---|
386 | |
---|
387 | **DESCRIPTION:** |
---|
388 | |
---|
389 | ``fcntl()`` performs one of various miscellaneous operations on``fd``. The operation in question is determined by ``cmd``: |
---|
390 | |
---|
391 | *F_DUPFD* |
---|
392 | Makes ``arg`` be a copy of ``fd``, closing ``fd`` first if necessary. |
---|
393 | The same functionality can be more easily achieved by using ``dup2()``. |
---|
394 | The old and new descriptors may be used interchangeably. They share locks, |
---|
395 | file position pointers and flags; for example, if the file position is |
---|
396 | modified by using ``lseek()`` on one of the descriptors, the position is |
---|
397 | also changed for the other. |
---|
398 | The two descriptors do not share the close-on-exec flag, however. The |
---|
399 | close-on-exec flag of the copy is off, meaning that it will be closed on |
---|
400 | exec. |
---|
401 | On success, the new descriptor is returned. |
---|
402 | |
---|
403 | *F_GETFD* |
---|
404 | Read the close-on-exec flag. If the low-order bit is 0, the file will |
---|
405 | remain open across exec, otherwise it will be closed. |
---|
406 | |
---|
407 | *F_SETFD* |
---|
408 | Set the close-on-exec flag to the value specified by ``arg`` (only the least |
---|
409 | significant bit is used). |
---|
410 | |
---|
411 | *F_GETFL* |
---|
412 | Read the descriptor's flags (all flags (as set by open()) are returned). |
---|
413 | |
---|
414 | *F_SETFL* |
---|
415 | Set the descriptor's flags to the value specified by ``arg``. Only``O_APPEND`` and ``O_NONBLOCK`` may be set. |
---|
416 | The flags are shared between copies (made with ``dup()`` etc.) of the same |
---|
417 | file descriptor. |
---|
418 | The flags and their semantics are described in ``open()``. |
---|
419 | |
---|
420 | *F_GETLK, F_SETLK and F_SETLKW* |
---|
421 | Manage discretionary file locks. The third argument ``arg`` is a pointer to a |
---|
422 | struct flock (that may be overwritten by this call). |
---|
423 | |
---|
424 | *F_GETLK* |
---|
425 | Return the flock structure that prevents us from obtaining the lock, or set the``l_type`` field of the lock to ``F_UNLCK`` if there is no obstruction. |
---|
426 | |
---|
427 | *F_SETLK* |
---|
428 | The lock is set (when ``l_type`` is ``F_RDLCK`` or ``F_WRLCK``) or |
---|
429 | cleared (when it is ``F_UNLCK``. If lock is held by someone else, this |
---|
430 | call returns -1 and sets ``errno`` to EACCES or EAGAIN. |
---|
431 | |
---|
432 | *F_SETLKW* |
---|
433 | Like ``F_SETLK``, but instead of returning an error we wait for the lock to |
---|
434 | be released. |
---|
435 | |
---|
436 | *F_GETOWN* |
---|
437 | Get the process ID (or process group) of the owner of a socket. |
---|
438 | Process groups are returned as negative values. |
---|
439 | |
---|
440 | *F_SETOWN* |
---|
441 | Set the process or process group that owns a socket. |
---|
442 | For these commands, ownership means receiving ``SIGIO`` or ``SIGURG`` |
---|
443 | signals. |
---|
444 | Process groups are specified using negative values. |
---|
445 | |
---|
446 | **NOTES:** |
---|
447 | |
---|
448 | The errors returned by ``dup2`` are different from those returned by``F_DUPFD``. |
---|
449 | |
---|
450 | lseek - Reposition read/write file offset |
---|
451 | ----------------------------------------- |
---|
452 | .. index:: lseek |
---|
453 | .. index:: reposition read/write file offset |
---|
454 | |
---|
455 | **CALLING SEQUENCE:** |
---|
456 | |
---|
457 | .. code:: c |
---|
458 | |
---|
459 | #include <sys/types.h> |
---|
460 | #include <unistd.h> |
---|
461 | int lseek( |
---|
462 | int fildes, |
---|
463 | off_t offset, |
---|
464 | int whence |
---|
465 | ); |
---|
466 | |
---|
467 | **STATUS CODES:** |
---|
468 | |
---|
469 | *EBADF* |
---|
470 | ``fildes`` is not an open file descriptor. |
---|
471 | |
---|
472 | *ESPIPE* |
---|
473 | ``fildes`` is associated with a pipe, socket or FIFO. |
---|
474 | |
---|
475 | *EINVAL* |
---|
476 | ``whence`` is not a proper value. |
---|
477 | |
---|
478 | **DESCRIPTION:** |
---|
479 | |
---|
480 | The ``lseek`` function repositions the offset of the file descriptor``fildes`` to the argument offset according to the directive whence. |
---|
481 | The argument ``fildes`` must be an open file descriptor. ``Lseek`` |
---|
482 | repositions the file pointer fildes as follows: |
---|
483 | |
---|
484 | - If ``whence`` is SEEK_SET, the offset is set to ``offset`` bytes. |
---|
485 | |
---|
486 | - If ``whence`` is SEEK_CUR, the offset is set to its current location |
---|
487 | plus offset bytes. |
---|
488 | |
---|
489 | - If ``whence`` is SEEK_END, the offset is set to the size of the |
---|
490 | file plus ``offset`` bytes. |
---|
491 | |
---|
492 | The ``lseek`` function allows the file offset to be set beyond the end |
---|
493 | of the existing end-of-file of the file. If data is later written at this |
---|
494 | point, subsequent reads of the data in the gap return bytes of zeros |
---|
495 | (until data is actually written into the gap). |
---|
496 | |
---|
497 | Some devices are incapable of seeking. The value of the pointer associated |
---|
498 | with such a device is undefined. |
---|
499 | |
---|
500 | **NOTES:** |
---|
501 | |
---|
502 | NONE |
---|
503 | |
---|
504 | fsync - Synchronize file complete in-core state with that on disk |
---|
505 | ----------------------------------------------------------------- |
---|
506 | .. index:: fsync |
---|
507 | .. index:: synchronize file complete in |
---|
508 | |
---|
509 | **CALLING SEQUENCE:** |
---|
510 | |
---|
511 | .. code:: c |
---|
512 | |
---|
513 | int fsync( |
---|
514 | int fd |
---|
515 | ); |
---|
516 | |
---|
517 | **STATUS CODES:** |
---|
518 | |
---|
519 | On success, zero is returned. On error, -1 is returned, and ``errno`` |
---|
520 | is set appropriately. |
---|
521 | |
---|
522 | *EBADF* |
---|
523 | ``fd`` is not a valid descriptor open for writing |
---|
524 | |
---|
525 | *EINVAL* |
---|
526 | ``fd`` is bound to a special file which does not support support synchronization |
---|
527 | |
---|
528 | *EROFS* |
---|
529 | ``fd`` is bound to a special file which does not support support synchronization |
---|
530 | |
---|
531 | *EIO* |
---|
532 | An error occurred during synchronization |
---|
533 | |
---|
534 | **DESCRIPTION:** |
---|
535 | |
---|
536 | ``fsync`` copies all in-core parts of a file to disk. |
---|
537 | |
---|
538 | **NOTES:** |
---|
539 | |
---|
540 | NONE |
---|
541 | |
---|
542 | fdatasync - Synchronize file in-core data with that on disk |
---|
543 | ----------------------------------------------------------- |
---|
544 | .. index:: fdatasync |
---|
545 | .. index:: synchronize file in |
---|
546 | |
---|
547 | **CALLING SEQUENCE:** |
---|
548 | |
---|
549 | .. code:: c |
---|
550 | |
---|
551 | int fdatasync( |
---|
552 | int fd |
---|
553 | ); |
---|
554 | |
---|
555 | **STATUS CODES:** |
---|
556 | |
---|
557 | On success, zero is returned. On error, -1 is returned, and ``errno`` is |
---|
558 | set appropriately. |
---|
559 | |
---|
560 | *EBADF* |
---|
561 | ``fd`` is not a valid file descriptor open for writing. |
---|
562 | |
---|
563 | *EINVAL* |
---|
564 | ``fd`` is bound to a special file which does not support synchronization. |
---|
565 | |
---|
566 | *EIO* |
---|
567 | An error occurred during synchronization. |
---|
568 | |
---|
569 | *EROFS* |
---|
570 | ``fd`` is bound to a special file which dows not support synchronization. |
---|
571 | |
---|
572 | **DESCRIPTION:** |
---|
573 | |
---|
574 | ``fdatasync`` flushes all data buffers of a file to disk (before the system call |
---|
575 | returns). It resembles ``fsync`` but is not required to update the metadata such |
---|
576 | as access time. |
---|
577 | |
---|
578 | Applications that access databases or log files often write a tiny data fragment |
---|
579 | (e.g., one line in a log file) and then call ``fsync`` immediately in order to |
---|
580 | ensure that the written data is physically stored on the harddisk. Unfortunately, |
---|
581 | fsync will always initiate two write operations: one for the newly written data and |
---|
582 | another one in order to update the modification time stored in the inode. If the |
---|
583 | modification time is not a part of the transaction concept ``fdatasync`` can be |
---|
584 | used to avoid unnecessary inode disk write operations. |
---|
585 | |
---|
586 | **NOTES:** |
---|
587 | |
---|
588 | NONE |
---|
589 | |
---|
590 | sync - Schedule file system updates |
---|
591 | ----------------------------------- |
---|
592 | .. index:: sync |
---|
593 | .. index:: synchronize file systems |
---|
594 | |
---|
595 | **CALLING SEQUENCE:** |
---|
596 | |
---|
597 | .. code:: c |
---|
598 | |
---|
599 | void sync(void); |
---|
600 | |
---|
601 | **STATUS CODES:** |
---|
602 | |
---|
603 | NONE |
---|
604 | |
---|
605 | **DESCRIPTION:** |
---|
606 | |
---|
607 | The ``sync`` service causes all information in memory that updates |
---|
608 | file systems to be scheduled for writing out to all file systems. |
---|
609 | |
---|
610 | **NOTES:** |
---|
611 | |
---|
612 | The writing of data to the file systems is only guaranteed to be |
---|
613 | scheduled upon return. It is not necessarily complete upon return |
---|
614 | from ``sync``. |
---|
615 | |
---|
616 | mount - Mount a file system |
---|
617 | --------------------------- |
---|
618 | .. index:: mount |
---|
619 | .. index:: mount a file system |
---|
620 | |
---|
621 | **CALLING SEQUENCE:** |
---|
622 | |
---|
623 | .. code:: c |
---|
624 | |
---|
625 | #include <libio.h> |
---|
626 | int mount( |
---|
627 | rtems_filesystem_mount_table_entry_t \**mt_entry, |
---|
628 | rtems_filesystem_operations_table \*fs_ops, |
---|
629 | rtems_filesystem_options_t fsoptions, |
---|
630 | char \*device, |
---|
631 | char \*mount_point |
---|
632 | ); |
---|
633 | |
---|
634 | **STATUS CODES:** |
---|
635 | |
---|
636 | *EXXX* |
---|
637 | |
---|
638 | **DESCRIPTION:** |
---|
639 | |
---|
640 | The ``mount`` routines mounts the filesystem class |
---|
641 | which uses the filesystem operations specified by ``fs_ops`` |
---|
642 | and ``fsoptions``. The filesystem is mounted at the directory``mount_point`` and the mode of the mounted filesystem is |
---|
643 | specified by ``fsoptions``. If this filesystem class requires |
---|
644 | a device, then the name of the device must be specified by ``device``. |
---|
645 | |
---|
646 | If this operation succeeds, the mount table entry for the mounted |
---|
647 | filesystem is returned in ``mt_entry``. |
---|
648 | |
---|
649 | **NOTES:** |
---|
650 | |
---|
651 | NONE |
---|
652 | |
---|
653 | unmount - Unmount file systems |
---|
654 | ------------------------------ |
---|
655 | .. index:: unmount |
---|
656 | .. index:: unmount file systems |
---|
657 | |
---|
658 | **CALLING SEQUENCE:** |
---|
659 | |
---|
660 | .. code:: c |
---|
661 | |
---|
662 | #include <libio.h> |
---|
663 | int unmount( |
---|
664 | const char \*mount_path |
---|
665 | ); |
---|
666 | |
---|
667 | **STATUS CODES:** |
---|
668 | |
---|
669 | *EXXX* |
---|
670 | |
---|
671 | **DESCRIPTION:** |
---|
672 | |
---|
673 | The ``unmount`` routine removes the attachment of the filesystem specified |
---|
674 | by ``mount_path``. |
---|
675 | |
---|
676 | **NOTES:** |
---|
677 | |
---|
678 | NONE |
---|
679 | |
---|
680 | readv - Vectored read from a file |
---|
681 | --------------------------------- |
---|
682 | .. index:: readv |
---|
683 | .. index:: vectored read from a file |
---|
684 | |
---|
685 | **CALLING SEQUENCE:** |
---|
686 | |
---|
687 | .. code:: c |
---|
688 | |
---|
689 | #include <sys/uio.h> |
---|
690 | ssize_t readv( |
---|
691 | int fd, |
---|
692 | const struct iovec \*iov, |
---|
693 | int iovcnt |
---|
694 | ); |
---|
695 | |
---|
696 | **STATUS CODES:** |
---|
697 | |
---|
698 | In addition to the errors detected by``Input and Output Primitives Manager read - Reads from a file, read()``, |
---|
699 | this routine may return -1 and sets ``errno`` based upon the following |
---|
700 | errors: |
---|
701 | |
---|
702 | *EINVAL* |
---|
703 | The sum of the ``iov_len`` values in the iov array overflowed an``ssize_t``. |
---|
704 | |
---|
705 | *EINVAL* |
---|
706 | The ``iovcnt`` argument was less than or equal to 0, or greater |
---|
707 | than ``IOV_MAX``. |
---|
708 | |
---|
709 | **DESCRIPTION:** |
---|
710 | |
---|
711 | The ``readv()`` function is equivalent to ``read()`` |
---|
712 | except as described here. The ``readv()`` function shall place |
---|
713 | the input data into the ``iovcnt`` buffers specified by the |
---|
714 | members of the ``iov`` array: ``iov[0], iov[1], ..., iov[iovcnt-1]``. |
---|
715 | |
---|
716 | Each ``iovec`` entry specifies the base address and length of an area |
---|
717 | in memory where data should be placed. The ``readv()`` function |
---|
718 | always fills an area completely before proceeding to the next. |
---|
719 | |
---|
720 | **NOTES:** |
---|
721 | |
---|
722 | NONE |
---|
723 | |
---|
724 | writev - Vectored write to a file |
---|
725 | --------------------------------- |
---|
726 | .. index:: writev |
---|
727 | .. index:: vectored write to a file |
---|
728 | |
---|
729 | **CALLING SEQUENCE:** |
---|
730 | |
---|
731 | .. code:: c |
---|
732 | |
---|
733 | #include <sys/uio.h> |
---|
734 | ssize_t writev( |
---|
735 | int fd, |
---|
736 | const struct iovec \*iov, |
---|
737 | int iovcnt |
---|
738 | ); |
---|
739 | |
---|
740 | **STATUS CODES:** |
---|
741 | |
---|
742 | In addition to the errors detected by``Input and Output Primitives Manager write - Write to a file, write()``, |
---|
743 | this routine may return -1 and sets ``errno`` based upon the following |
---|
744 | errors: |
---|
745 | |
---|
746 | *EINVAL* |
---|
747 | The sum of the ``iov_len`` values in the iov array overflowed an``ssize_t``. |
---|
748 | |
---|
749 | *EINVAL* |
---|
750 | The ``iovcnt`` argument was less than or equal to 0, or greater |
---|
751 | than ``IOV_MAX``. |
---|
752 | |
---|
753 | **DESCRIPTION:** |
---|
754 | |
---|
755 | The ``writev()`` function is equivalent to ``write()``, |
---|
756 | except as noted here. The ``writev()`` function gathers output |
---|
757 | data from the ``iovcnt`` buffers specified by the members of |
---|
758 | the ``iov array``: ``iov[0], iov[1], ..., iov[iovcnt-1]``. |
---|
759 | The ``iovcnt`` argument is valid if greater than 0 and less |
---|
760 | than or equal to ``IOV_MAX``. |
---|
761 | |
---|
762 | Each ``iovec`` entry specifies the base address and length of |
---|
763 | an area in memory from which data should be written. The ``writev()`` |
---|
764 | function always writes a complete area before proceeding to the next. |
---|
765 | |
---|
766 | If ``fd`` refers to a regular file and all of the ``iov_len`` |
---|
767 | members in the array pointed to by ``iov`` are 0, ``writev()`` |
---|
768 | returns 0 and has no other effect. For other file types, the behavior |
---|
769 | is unspecified by POSIX. |
---|
770 | |
---|
771 | **NOTES:** |
---|
772 | |
---|
773 | NONE |
---|
774 | |
---|
775 | aio_read - Asynchronous Read |
---|
776 | ---------------------------- |
---|
777 | .. index:: aio_read |
---|
778 | .. index:: asynchronous read |
---|
779 | |
---|
780 | **CALLING SEQUENCE:** |
---|
781 | |
---|
782 | .. code:: c |
---|
783 | |
---|
784 | int aio_read( |
---|
785 | ); |
---|
786 | |
---|
787 | **STATUS CODES:** |
---|
788 | |
---|
789 | *E* |
---|
790 | The |
---|
791 | |
---|
792 | **DESCRIPTION:** |
---|
793 | |
---|
794 | **NOTES:** |
---|
795 | |
---|
796 | This routine is not currently supported by RTEMS but could be |
---|
797 | in a future version. |
---|
798 | |
---|
799 | aio_write - Asynchronous Write |
---|
800 | ------------------------------ |
---|
801 | .. index:: aio_write |
---|
802 | .. index:: asynchronous write |
---|
803 | |
---|
804 | **CALLING SEQUENCE:** |
---|
805 | |
---|
806 | .. code:: c |
---|
807 | |
---|
808 | int aio_write( |
---|
809 | ); |
---|
810 | |
---|
811 | **STATUS CODES:** |
---|
812 | |
---|
813 | *E* |
---|
814 | The |
---|
815 | |
---|
816 | **DESCRIPTION:** |
---|
817 | |
---|
818 | **NOTES:** |
---|
819 | |
---|
820 | This routine is not currently supported by RTEMS but could be |
---|
821 | in a future version. |
---|
822 | |
---|
823 | lio_listio - List Directed I/O |
---|
824 | ------------------------------ |
---|
825 | .. index:: lio_listio |
---|
826 | .. index:: list directed i/o |
---|
827 | |
---|
828 | **CALLING SEQUENCE:** |
---|
829 | |
---|
830 | .. code:: c |
---|
831 | |
---|
832 | int lio_listio( |
---|
833 | ); |
---|
834 | |
---|
835 | **STATUS CODES:** |
---|
836 | |
---|
837 | *E* |
---|
838 | The |
---|
839 | |
---|
840 | **DESCRIPTION:** |
---|
841 | |
---|
842 | **NOTES:** |
---|
843 | |
---|
844 | This routine is not currently supported by RTEMS but could be |
---|
845 | in a future version. |
---|
846 | |
---|
847 | aio_error - Retrieve Error Status of Asynchronous I/O Operation |
---|
848 | --------------------------------------------------------------- |
---|
849 | .. index:: aio_error |
---|
850 | .. index:: retrieve error status of asynchronous i/o operation |
---|
851 | |
---|
852 | **CALLING SEQUENCE:** |
---|
853 | |
---|
854 | .. code:: c |
---|
855 | |
---|
856 | int aio_error( |
---|
857 | ); |
---|
858 | |
---|
859 | **STATUS CODES:** |
---|
860 | |
---|
861 | *E* |
---|
862 | The |
---|
863 | |
---|
864 | **DESCRIPTION:** |
---|
865 | |
---|
866 | **NOTES:** |
---|
867 | |
---|
868 | This routine is not currently supported by RTEMS but could be |
---|
869 | in a future version. |
---|
870 | |
---|
871 | aio_return - Retrieve Return Status Asynchronous I/O Operation |
---|
872 | -------------------------------------------------------------- |
---|
873 | .. index:: aio_return |
---|
874 | .. index:: retrieve return status asynchronous i/o operation |
---|
875 | |
---|
876 | **CALLING SEQUENCE:** |
---|
877 | |
---|
878 | .. code:: c |
---|
879 | |
---|
880 | int aio_return( |
---|
881 | ); |
---|
882 | |
---|
883 | **STATUS CODES:** |
---|
884 | |
---|
885 | *E* |
---|
886 | The |
---|
887 | |
---|
888 | **DESCRIPTION:** |
---|
889 | |
---|
890 | **NOTES:** |
---|
891 | |
---|
892 | This routine is not currently supported by RTEMS but could be |
---|
893 | in a future version. |
---|
894 | |
---|
895 | aio_cancel - Cancel Asynchronous I/O Request |
---|
896 | -------------------------------------------- |
---|
897 | .. index:: aio_cancel |
---|
898 | .. index:: cancel asynchronous i/o request |
---|
899 | |
---|
900 | **CALLING SEQUENCE:** |
---|
901 | |
---|
902 | .. code:: c |
---|
903 | |
---|
904 | int aio_cancel( |
---|
905 | ); |
---|
906 | |
---|
907 | **STATUS CODES:** |
---|
908 | |
---|
909 | *E* |
---|
910 | The |
---|
911 | |
---|
912 | **DESCRIPTION:** |
---|
913 | |
---|
914 | **NOTES:** |
---|
915 | |
---|
916 | This routine is not currently supported by RTEMS but could be |
---|
917 | in a future version. |
---|
918 | |
---|
919 | aio_suspend - Wait for Asynchronous I/O Request |
---|
920 | ----------------------------------------------- |
---|
921 | .. index:: aio_suspend |
---|
922 | .. index:: wait for asynchronous i/o request |
---|
923 | |
---|
924 | **CALLING SEQUENCE:** |
---|
925 | |
---|
926 | .. code:: c |
---|
927 | |
---|
928 | int aio_suspend( |
---|
929 | ); |
---|
930 | |
---|
931 | **STATUS CODES:** |
---|
932 | |
---|
933 | *E* |
---|
934 | The |
---|
935 | |
---|
936 | **DESCRIPTION:** |
---|
937 | |
---|
938 | **NOTES:** |
---|
939 | |
---|
940 | This routine is not currently supported by RTEMS but could be |
---|
941 | in a future version. |
---|
942 | |
---|
943 | aio_fsync - Asynchronous File Synchronization |
---|
944 | --------------------------------------------- |
---|
945 | .. index:: aio_fsync |
---|
946 | .. index:: asynchronous file synchronization |
---|
947 | |
---|
948 | **CALLING SEQUENCE:** |
---|
949 | |
---|
950 | .. code:: c |
---|
951 | |
---|
952 | int aio_fsync( |
---|
953 | ); |
---|
954 | |
---|
955 | **STATUS CODES:** |
---|
956 | |
---|
957 | *E* |
---|
958 | The |
---|
959 | |
---|
960 | **DESCRIPTION:** |
---|
961 | |
---|
962 | **NOTES:** |
---|
963 | |
---|
964 | This routine is not currently supported by RTEMS but could be |
---|
965 | in a future version. |
---|
966 | |
---|
967 | .. COMMENT: COPYRIGHT (c) 1988-2002. |
---|
968 | |
---|
969 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
970 | |
---|
971 | .. COMMENT: All rights reserved. |
---|
972 | |
---|