psxhdrs:Add POSIX conformance test for utime.h (GCI 2018)

This commit is contained in:
Shashvat Jain
2018-12-02 20:36:54 -05:00
committed by Joel Sherrill
parent b8e8d0dea9
commit 7383632c80
2 changed files with 42 additions and 0 deletions

View File

@@ -1069,6 +1069,7 @@ lib_a_SOURCES = psxhdrs/devctl/posix_devctl.c \
psxhdrs/unistd/setsid.c psxhdrs/unistd/setuid.c \
psxhdrs/unistd/sleep.c psxhdrs/unistd/sync.c psxhdrs/unistd/ualarm.c \
psxhdrs/unistd/usleep.c psxhdrs/sys/mman/mlockall.c \
psxhdrs/utime/utime.c \
psxhdrs/sys/mman/mlock.c psxhdrs/sys/mman/mmap.c \
psxhdrs/sys/mman/mprotect.c psxhdrs/sys/mman/msync.c \
psxhdrs/sys/mman/munlockall.c psxhdrs/sys/mman/munlock.c \

View File

@@ -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;
}