| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) | 
Create a connection and attach it to the HA lib
#include <ha/fcntl.h>
    
int ha_creat(const char *path,
             mode_t mode,
             RFp rfn,
             void *rhdl, 
             unsigned haflags);
int ha_creat64(const char *path, 
               mode_t mode,      
               RFp rfn,          
               void *rhdl,       
               unsigned haflags);
libha
In addition to opening the connection using the standard create|64() call, these convenience functions also call ha_attach() with the connection returned by the creat() call.
The parameters rfn(), and rhdl(), and haflags() are passed to the ha_attach() call along with the connection ID returned by the creat() call.
The remaining parameters are passed to the corresponding parameters in the creat() call in their appropriate positions.
A new connection ID or -1 if an error occurred (errno is set).
The ha_creat() call returns errors as returned by either the underlying creat() call or the ha_attach() call.
| Safety: | |
|---|---|
| Cancellation point | No | 
| Interrupt handler | No | 
| Signal handler | No | 
| Thread | Yes | 
ha_open(), ha_attach(), ha_close(), ha_detach()
In the Library Reference: creat()
| ![[Previous]](../prev.gif) | ![[Contents]](../contents.gif) | ![[Index]](../keyword_index.gif) | ![[Next]](../next.gif) |