| 1 |
/**************************************************************************/ |
| 2 |
/* */ |
| 3 |
/* This file is part of Frama-C. */ |
| 4 |
/* */ |
| 5 |
/* Copyright (C) 2007-2022 */ |
| 6 |
/* CEA (Commissariat à l'énergie atomique et aux énergies */ |
| 7 |
/* alternatives) */ |
| 8 |
/* */ |
| 9 |
/* you can redistribute it and/or modify it under the terms of the GNU */ |
| 10 |
/* Lesser General Public License as published by the Free Software */ |
| 11 |
/* Foundation, version 2.1. */ |
| 12 |
/* */ |
| 13 |
/* It is distributed in the hope that it will be useful, */ |
| 14 |
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
| 15 |
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
| 16 |
/* GNU Lesser General Public License for more details. */ |
| 17 |
/* */ |
| 18 |
/* See the GNU Lesser General Public License version 2.1 */ |
| 19 |
/* for more details (enclosed in the file licenses/LGPLv2.1). */ |
| 20 |
/* */ |
| 21 |
/**************************************************************************/ |
| 22 |
|
| 23 |
// Non-POSIX; Linux-specific |
| 24 |
|
| 25 |
#ifndef __FC_SYS_SENDFILE_H__ |
| 26 |
#define __FC_SYS_SENDFILE_H__ |
| 27 |
|
| 28 |
#include "../features.h" |
| 29 |
__PUSH_FC_STDLIB |
| 30 |
__BEGIN_DECLS |
| 31 |
|
| 32 |
#include "../__fc_define_max_open_files.h" |
| 33 |
#include "../__fc_define_off_t.h" |
| 34 |
#include "../__fc_define_size_t.h" |
| 35 |
#include "../__fc_define_ssize_t.h" |
| 36 |
#include "../errno.h" |
| 37 |
|
| 38 |
/*@ |
| 39 |
//missing: requires in_fd opened for reading |
| 40 |
//missing: requires out_fd opened for writing |
| 41 |
requires valid_in_fd: 0 <= in_fd < __FC_MAX_OPEN_FILES; |
| 42 |
requires valid_out_fd: 0 <= out_fd < __FC_MAX_OPEN_FILES; |
| 43 |
requires valid_offset_or_null: offset == \null || \valid(offset); |
| 44 |
requires initialization:offset: offset == \null || \initialized(offset); |
| 45 |
assigns errno, \result, *offset \from indirect:out_fd, indirect:in_fd, |
| 46 |
indirect:offset, indirect:count; |
| 47 |
//missing: assigns "out_fd's state (offset/buffer if file; or socket's state)" |
| 48 |
//missing: assigns "in_fd's offset, if offset == null" |
| 49 |
ensures error_or_chars_sent: \result == -1 || 0 <= \result <= count; |
| 50 |
ensures initialization:offset: \initialized(offset); |
| 51 |
*/ |
| 52 |
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count); |
| 53 |
|
| 54 |
__END_DECLS |
| 55 |
__POP_FC_STDLIB |
| 56 |
#endif |