| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) | 
Compare two directory entries
#include <sys/types.h>
#include <sys/dir.h>
struct direct {
    unsigned long d_fileno;
    unsigned short d_reclen;
    unsigned short d_namlen;
    char d_name[1];
};
int alphasort( struct direct **d1,
               struct direct **d2);
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
|  | This function is in libc.a, but not in libc.so (in order to save space). | 
The alphasort() function alphabetically compares two directory entries. You can use it as the compar argument to scandir().
| Safety: | |
|---|---|
| Cancellation point | No | 
| Interrupt handler | Yes | 
| Signal handler | Yes | 
| Thread | Yes | 
closedir(), opendir(), readdir(), rewinddir(), scandir(), seekdir(), telldir()
| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) |