annotate loadagent/libnosys/lseek.c @ 7:aa1f6fe16fef

loadtools building blocks started
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 30 Apr 2013 07:19:48 +0000
parents da98dc08f575
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /* lseek.c -- move read/write pointer.
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 *
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 * Copyright (c) 1995 Cygnus Support
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 *
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 * The authors hereby grant permission to use, copy, modify, distribute,
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 * and license this software and its documentation for any purpose, provided
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 * that existing copyright notices are retained in all copies and that this
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 * notice is included verbatim in any distributions. No written agreement,
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 * license, or royalty fee is required for any of the authorized uses.
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 * Modifications to this software may be copyrighted by their authors
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 * and need not follow the licensing terms described here, provided that
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 * the new terms are clearly indicated on the first page of each file where
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 * they apply.
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 */
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 #include <sys/types.h>
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 #include <errno.h>
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 #include "glue.h"
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 /*
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 * lseek -- Since a serial port is non-seekable, we return an error.
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21 */
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 off_t
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 _DEFUN (_lseek, (fd, offset, whence),
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24 int fd _AND
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 off_t offset _AND
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 int whence)
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 {
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 errno = ESPIPE;
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 return ((off_t)-1);
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30 }
da98dc08f575 loadagent: beginning to lay the foundation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31