diff options
author | Shashvat Jain <shashvatjain2002@gmail.com> | 2018-12-02 20:36:54 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2018-12-02 22:04:19 -0600 |
commit | 7383632c806224d708e9ac658094d701cb0f539a (patch) | |
tree | 091bba0e43dd9ecad1d06e25410f1033849e624b /testsuites/psxtests/psxhdrs/utime/utime.c | |
parent | b8e8d0dea9a8c0c7a49080af4f07fdbd5680604c (diff) |
psxhdrs:Add POSIX conformance test for utime.h (GCI 2018)
Diffstat (limited to 'testsuites/psxtests/psxhdrs/utime/utime.c')
-rw-r--r-- | testsuites/psxtests/psxhdrs/utime/utime.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxhdrs/utime/utime.c b/testsuites/psxtests/psxhdrs/utime/utime.c new file mode 100644 index 0000000000..e16bfc6aac --- /dev/null +++ b/testsuites/psxtests/psxhdrs/utime/utime.c @@ -0,0 +1,41 @@ +/** + * @file + * @brief utime() API Conformance Test + */ + + /* + * COPYRIGHT (c) 2018. + * Shashvat Jain + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose with or without fee is hereby granted. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include <sys/types.h> + +#include <utime.h> + +int test( void ); + +int test( void ) +{ + int result; + const struct utimbuf buff; + const char *path = "/tmp/myfile"; + + result = utime(path, &buff); + + return result; +} |