Nios® V Processor Software Developer Handbook

ID 743810
Date 10/02/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

13.1.1.32. alt_fs_reg()

Prototype

int alt_fs_reg (alt_dev* dev)

Commonly Called By

Device drivers

Thread-safe

No.

Available from ISR

No.

Include

<sys/alt_dev.h>

Description

The alt_fs_reg() function registers a file system with the HAL. After it is registered, a file system can be accessed using the standard I/O functions.

For more information, refer to the "Developing Programs Using the Hardware Abstraction Layer" section.

System behavior is undefined in the event that a file system is registered with a name that conflicts with an existing device or file system.

alt_fs_reg() is not thread-safe if other threads are using the device list at the time that alt_fs_reg() is called. Call alt_fs_reg() only in the following circumstances:

  • When running in single-threaded mode.
  • From a device initialization function called by alt_sys_init(). alt_sys_init() may only be called by the single-threaded C startup code.

Return

The return value is zero upon success. A negative return value indicates failure.