Nios® V Processor Software Developer Handbook

ID 743810
Date 7/08/2024
Public
Document Table of Contents

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