Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

14.1.66. stat()

Prototype

int stat(const char *file_name,

struct stat *buf);

Commonly Called By

C/C++ programs

Device drivers

Thread-safe

See description.

Available from ISR

No.

Include

<sys/stat.h>

Description

The stat() function is similar to the fstat() function—It obtains status information about a file. Instead of using an open file descriptor, like fstat(), stat() takes the name of a file as an input argument.

Calls to stat() are thread-safe only if the implementation of stat() provided by the driver that is manipulated is thread-safe.

Internally, the stat() function is implemented as a call to fstat().

Return

--