|
Last change
on this file since 2309 was 1815, checked in by bird, 21 years ago |
|
read link return code testcase.readlink-1.
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
|
File size:
599 bytes
|
| Line | |
|---|
| 1 | #include <stdio.h>
|
|---|
| 2 | #include <unistd.h>
|
|---|
| 3 | #include <errno.h>
|
|---|
| 4 |
|
|---|
| 5 | int main(int argc, char **argv)
|
|---|
| 6 | {
|
|---|
| 7 | #if 1
|
|---|
| 8 | char szLink[4096] = {0};
|
|---|
| 9 | int rc = readlink(argv[0], szLink, sizeof(szLink));
|
|---|
| 10 | if (errno != EINVAL)
|
|---|
| 11 | {
|
|---|
| 12 | printf("readlink-1: FAILURE - errno %d\n", errno);
|
|---|
| 13 | return 1;
|
|---|
| 14 | }
|
|---|
| 15 | printf("readlink-1: SUCCESS\n");
|
|---|
| 16 | return 0;
|
|---|
| 17 | #else
|
|---|
| 18 | int i;
|
|---|
| 19 | for (i = 1; i < argc; i++)
|
|---|
| 20 | {
|
|---|
| 21 | char szLink[4096] = {0};
|
|---|
| 22 | int rc = readlink(argv[i], szLink, sizeof(szLink));
|
|---|
| 23 | printf("rc=%d errno=%d '%s' '%s'\n", rc, errno, argv[i], szLink);
|
|---|
| 24 | }
|
|---|
| 25 | return 0;
|
|---|
| 26 | #endif
|
|---|
| 27 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.