[SunHELP] utime /dev/fd/1

Nicholas Dronen sunhelp at sunhelp.org
Tue Dec 11 10:05:42 CST 2001


On Tue, Dec 11, 2001 at 12:15:20AM -0800, Will Yardley wrote:
> i am using the pkg-get script to install stuff from the solaris freeware
> site, and i'm getting the following error (during the part where it uses
> 'wget' to retrieve the files:
> 
> utime(/dev/fd/1): Operation not applicable

utimes(2) is a system call for altering the file access,
modification (and, indirectly, inode change) times; 
/dev/fd/1 is a character device file the access and
modification times of which cannot be set using utimes(2),
which is why utimes sets errno to ENOSYS ("Unsupported file
system operation").

$ cat utime.c
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <utime.h>

int main(int argc, char *argv[])
{
        int rc = utimes("/dev/fd/1", NULL);
        if (rc == -1) {
                fprintf(stderr, "utimes: %d; %s\n",
                errno, strerror(errno));
                exit(EXIT_FAILURE);
        }
        exit(EXIT_SUCCESS);
}

$ make utime
cc     utime.c   -o utime
$ ./utime
utimes: 89; Operation not applicable
$ grep 89 /usr/include/sys/errno.h | grep define
#define ENOSYS  89      /* Unsupported file system operation    */

Perhaps someone else can answer your security question.

Regards,

Nicholas Dronen



More information about the SunHELP mailing list