File: load.c

package info (click to toggle)
tinyssh 20250501-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,388 kB
  • sloc: ansic: 20,245; sh: 1,582; python: 1,449; makefile: 913
file content (19 lines) | stat: -rw-r--r-- 366 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
taken from nacl-20110221, from curvecp/load.c
- reformated using clang-format
*/
#include <unistd.h>
#include "readall.h"
#include "open.h"
#include "e.h"
#include "load.h"

int load(const char *fn, void *x, long long xlen) {
    int fd;
    int r;
    fd = open_read(fn);
    if (fd == -1) return -1;
    r = readall(fd, x, xlen);
    close(fd);
    return r;
}