summaryrefslogtreecommitdiff
path: root/tests/test-lstat.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-10-27 11:03:33 +0100
committerSimon Josefsson <simon@josefsson.org>2008-10-27 11:03:33 +0100
commit3ff8a9d0d29f6fe7ce697d9f7824c09a99bc1e1b (patch)
tree5a9369f172172bdd78f884087b45e5b340d0a465 /tests/test-lstat.c
parenteef75012ee8703c35e0268ee9b6d23881771a1b8 (diff)
downloadgnulib-3ff8a9d0d29f6fe7ce697d9f7824c09a99bc1e1b.tar.gz
lstat: New module.
Diffstat (limited to 'tests/test-lstat.c')
-rw-r--r--tests/test-lstat.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/test-lstat.c b/tests/test-lstat.c
new file mode 100644
index 0000000000..0d58f6bc53
--- /dev/null
+++ b/tests/test-lstat.c
@@ -0,0 +1,35 @@
+/* Test of lstat() function.
+ Copyright (C) 2008 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson, 2008. */
+
+#include <config.h>
+
+#include <sys/stat.h>
+
+int
+main (int argc, char **argv)
+{
+ struct stat buf;
+
+ if (lstat ("/", &buf) != 0)
+ {
+ perror ("lstat");
+ return 1;
+ }
+
+ return 0;
+}