Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
ELFTC_SET_TIMESTAMPS(3)	 BSD Library Functions Manual  ELFTC_SET_TIMESTAMPS(3)

NAME
     elftc_set_timestamps -- set file timestamps

LIBRARY
     library "libelftc"

SYNOPSIS
     #include <libelftc.h>

     int
     elftc_set_timestamps(const	char *filename,	struct stat *sb);

DESCRIPTION
     The elftc_set_timestamps()	function is used to set	the access and modi-
     fied time stamps on a file	based on the contents of a struct stat de-
     scriptor.

     Argument filename names an	existing file in the file system.

     Argument sb points	to structure of	type struct stat populated by a	prior
     call to fstat(2) or stat(2).

IMPLEMENTATION NOTES
     This function will	invoke the high-resolution utimes(2) system call if
     the underlying operating system supports it.  On operating	systems	lack-
     ing support for utimes(2),	the function will use lower resolution
     utime(2) system call.

EXAMPLES
     To	set the	access and modified times for a	new file to those of an	exist-
     ing file, use:

	   struct stat sb;
	   const char *existing_filename, *new_filename;

	   if (stat(existing_filename, &sb) < 0)
		   err(EXIT_FAILURE, "stat failed");

	   if (elftc_set_timestamps(new_filename, &sb) < 0)
		   err(EXIT_FAILURE, "timestamps could not be set");

SEE ALSO
     fstat(2), stat(2),	utime(2), utimes(2).

BSD			       December	15, 2011			   BSD

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | IMPLEMENTATION NOTES | EXAMPLES | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=elftc_set_timestamps&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help