Module: xenomai-head
Branch: master
Commit: bd1f08d003012b185a55235d4ee9ade5d5beabc7
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=bd1f08d003012b185a55235d4ee9ade5d5beabc7

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Thu Nov 19 13:05:21 2009 +0100

analogy: add some details on the error codes for the syscall API

---

 src/drvlib/analogy/sys.c |   41 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/src/drvlib/analogy/sys.c b/src/drvlib/analogy/sys.c
index 4c71039..51edcfe 100644
--- a/src/drvlib/analogy/sys.c
+++ b/src/drvlib/analogy/sys.c
@@ -85,7 +85,14 @@ int a4l_sys_close(int fd)
  * @param[out] buf Input buffer
  * @param[in] nbyte Number of bytes to read
  *
- * @return Number of bytes read, otherwise negative error code.
+ * @return Number of bytes read. Otherwise:
+ *
+ * - -EINVAL is returned if some argument is missing or wrong (Please,
+ *    type "dmesg" for more info)
+ * - -ENOENT is returned if the device's reading subdevice is idle (no
+ *    command was sent)
+ * - -EFAULT is returned if a user <-> kernel transfer went wrong
+ * - -EINTR is returned if calling task has been unblocked by a signal
  *
  */
 int a4l_sys_read(int fd, void *buf, size_t nbyte)
@@ -103,7 +110,14 @@ int a4l_sys_read(int fd, void *buf, size_t nbyte)
  * @param[in] buf Output buffer
  * @param[in] nbyte Number of bytes to write
  *
- * @return Number of bytes written, otherwise negative error code.
+ * @return Number of bytes written. Otherwise:
+ *
+ * - -EINVAL is returned if some argument is missing or wrong (Please,
+ *    type "dmesg" for more info)
+ * - -ENOENT is returned if the device's writing subdevice is idle (no
+ *    command was sent)
+ * - -EFAULT is returned if a user <-> kernel transfer went wrong
+ * - -EINTR is returned if calling task has been unblocked by a signal
  *
  */
 int a4l_sys_write(int fd, void *buf, size_t nbyte)
@@ -125,7 +139,16 @@ int a4l_sys_write(int fd, void *buf, size_t nbyte)
  * @param[in] fd File descriptor as returned by a4l_sys_open()
  * @param[in] arg Link descriptor argument
  *
- * @return 0 on success, otherwise a negative error code.
+ * @return 0 on success. Otherwise:
+ *
+ * - -ENOMEM is returned if the system is out of memory
+ * - -EINVAL is returned if some argument is missing or wrong (Please,
+ *    type "dmesg" for more info)
+ * - -EFAULT is returned if a user <-> kernel transfer went wrong
+ * - -ENODEV is returned in case of internal error (Please, type
+ *    "dmesg" for more info)
+ * - -ENXIO is returned in case of internal error (Please, type
+ *    "dmesg" for more info)
  *
  */
 int a4l_sys_attach(int fd, a4l_lnkdesc_t * arg)
@@ -138,7 +161,17 @@ int a4l_sys_attach(int fd, a4l_lnkdesc_t * arg)
  *
  * @param[in] fd File descriptor as returned by a4l_sys_open()
  *
- * @return 0 on success, otherwise a negative error code.
+ * @return 0 on success. Otherwise:
+ *
+ * - -EINVAL is returned if some argument is missing or wrong (Please,
+ *    type "dmesg" for more info)
+ * - -EBUSY is returned if the device to be detached is in use
+ * - -EPERM is returned if the devive to be detached still has some
+ *    buffer mapped in user-space
+ * - -ENODEV is returned in case of internal error (Please, type
+ *    "dmesg" for more info)
+ * - -ENXIO is returned in case of internal error (Please, type
+ *    "dmesg" for more info)
  *
  */
 int a4l_sys_detach(int fd)


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to