X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fexample%2Ffunctions%2F_PDCLIB%2Frename.c;h=7d174da35927b93120ef30a526c0aae43e0fe358;hb=e1c526e9bad3f6e69391e94059096145390508d3;hp=90b2290fd60126fff8bbad4dff77f656c9c5e4ce;hpb=b08f4b52b1cd1f7a9553c0f357a7c90859fa3e73;p=pdclib diff --git a/platform/example/functions/_PDCLIB/rename.c b/platform/example/functions/_PDCLIB/rename.c index 90b2290..7d174da 100644 --- a/platform/example/functions/_PDCLIB/rename.c +++ b/platform/example/functions/_PDCLIB/rename.c @@ -1,30 +1,18 @@ -/* $Id$ */ - /* _PDCLIB_rename( const char *, const char * ) This file is part of the Public Domain C Library (PDCLib). Permission is granted to use, modify, and / or redistribute at will. */ +#include + #ifndef REGTEST -#include #include <_PDCLIB_glue.h> +#include int _PDCLIB_rename( const char * old, const char * new ) { - /* Note that the behaviour if new file exists is implementation-defined. - There is nothing wrong with either overwriting it or failing the - operation, but you might want to document whichever you chose. - This example fails if new file exists. - */ - if ( link( old, new ) == 0 ) - { - return unlink( old ); - } - else - { - return -1; - } + errno = ENOTSUP; } #endif @@ -32,9 +20,10 @@ int _PDCLIB_rename( const char * old, const char * new ) #ifdef TEST #include <_PDCLIB_test.h> +#include + int main( void ) { - TESTCASE( NO_TESTDRIVER ); return TEST_RESULTS; }