Commit db83cc35 authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Merge branch...

Merge branch '28-norns_wait-nornsctl_wait-should-accept-a-second-parameter-to-specify-a-timeout' into 'master'

Resolve "norns_wait()/nornsctl_wait() should accept a second parameter to specify a timeout"

Closes #28

See merge request !12
parents 8fe820ad 18708495
Loading
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -32,9 +32,9 @@
#define NORNS_API_VERSION 10
#endif

#include <sys/types.h>
#include <stdint.h>
#include <assert.h>
#include <stdint.h>     /* For uint32_t et al. */
#include <stdbool.h>    /* For bool */
#include <time.h>       /* For struct timespec */

#include "norns_types.h"
#include "norns_error.h"
@@ -68,7 +68,8 @@ norns_submit(norns_iotask_t* task) __THROW;

/* wait for the completion of the I/O task associated to 'task' */
norns_error_t 
norns_wait(norns_iotask_t* task) __THROW;
norns_wait(norns_iotask_t* task,
           const struct timespec* timeout) __THROW;

/* Try to cancel an asynchronous I/O task associated with task */
norns_error_t 
+5 −4
Original line number Diff line number Diff line
@@ -45,12 +45,13 @@ extern "C" {
#define NORNS_EBADARGS            -2
#define NORNS_EBADREQUEST         -3
#define NORNS_ENOMEM              -4
#define NORNS_ETIMEOUT            -5

/* errors about communication */
#define NORNS_ECONNFAILED         -5
#define NORNS_ERPCSENDFAILED      -6
#define NORNS_ERPCRECVFAILED      -7
#define NORNS_EACCEPTPAUSED       -8
#define NORNS_ECONNFAILED         -6
#define NORNS_ERPCSENDFAILED      -7
#define NORNS_ERPCRECVFAILED      -8
#define NORNS_EACCEPTPAUSED       -9

/* errors about jobs */
#define NORNS_EJOBEXISTS         -10
+0 −2
Original line number Diff line number Diff line
@@ -29,8 +29,6 @@
#define __NORNS_TYPES_H__ 1

#include <sys/types.h>
#include <stdint.h>     /* For uint32_t et al. */
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
+6 −1
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@
#define NORNSCTL_API_VERSION 10
#endif

#include <stdint.h>     /* For uint32_t et al. */
#include <stdbool.h>    /* For bool */
#include <time.h>       /* For struct timespec */

#include "norns_types.h"
#include "norns_error.h"

@@ -191,7 +195,8 @@ nornsctl_submit(norns_iotask_t* task) __THROW;

/* wait for the completion of the I/O task associated to 'task' */
norns_error_t 
nornsctl_wait(norns_iotask_t* task) __THROW;
nornsctl_wait(norns_iotask_t* task,
              const struct timespec* timeout) __THROW;

/* Try to cancel an asynchronous I/O task associated with task */
norns_error_t 
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ const char* const norns_errlist[NORNS_ERRMAX + 1] = {
    [ERR_REMAP(NORNS_EBADREQUEST)] = "Bad request",
    [ERR_REMAP(NORNS_EBADARGS)] = "Bad arguments",
    [ERR_REMAP(NORNS_ENOMEM)] = "Cannot allocate memory",
    [ERR_REMAP(NORNS_ETIMEOUT)] = "Timeout exceeded",

    /* communication errors */
    [ERR_REMAP(NORNS_ECONNFAILED)] = "Cannot connect to daemon",
Loading