Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

15.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

--