A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- Reduce the number of system headers loaded, overload some more system
[simgrid.git]
/
src
/
gras
/
Transport
/
transport_plugin_file.c
diff --git
a/src/gras/Transport/transport_plugin_file.c
b/src/gras/Transport/transport_plugin_file.c
index
6a52c08
..
825d2bc
100644
(file)
--- a/
src/gras/Transport/transport_plugin_file.c
+++ b/
src/gras/Transport/transport_plugin_file.c
@@
-12,11
+12,13
@@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <unistd.h>
#include "gras_private.h"
#include "transport_private.h"
#include "gras_private.h"
#include "transport_private.h"
-GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(trp_file,transport);
+GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(trp_file,transport,
+ "Pseudo-transport to write to/read from a file");
/***
*** Prototypes
/***
*** Prototypes
@@
-24,12
+26,12
@@
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(trp_file,transport);
void gras_trp_file_close(gras_socket_t *sd);
gras_error_t gras_trp_file_chunk_send(gras_socket_t *sd,
void gras_trp_file_close(gras_socket_t *sd);
gras_error_t gras_trp_file_chunk_send(gras_socket_t *sd,
- char *data,
-
size_
t size);
+ c
onst c
har *data,
+
long in
t size);
gras_error_t gras_trp_file_chunk_recv(gras_socket_t *sd,
char *data,
gras_error_t gras_trp_file_chunk_recv(gras_socket_t *sd,
char *data,
-
size_
t size);
+
long in
t size);
/***
/***
@@
-52,7
+54,7
@@
typedef struct {
gras_error_t
gras_trp_file_setup(gras_trp_plugin_t *plug) {
gras_error_t
gras_trp_file_setup(gras_trp_plugin_t *plug) {
- gras_trp_file_plug_data_t *file =
malloc(sizeof(gras_trp_file_plug_data_t)
);
+ gras_trp_file_plug_data_t *file =
gras_new(gras_trp_file_plug_data_t,1
);
if (!file)
RAISE_MALLOC;
if (!file)
RAISE_MALLOC;
@@
-185,8
+187,8
@@
void gras_trp_file_close(gras_socket_t *sock){
*/
gras_error_t
gras_trp_file_chunk_send(gras_socket_t *sock,
*/
gras_error_t
gras_trp_file_chunk_send(gras_socket_t *sock,
- char *data,
-
size_
t size) {
+ c
onst c
har *data,
+
long in
t size) {
gras_assert0(sock->outgoing, "Cannot write on client file socket");
gras_assert0(size >= 0, "Cannot send a negative amount of data");
gras_assert0(sock->outgoing, "Cannot write on client file socket");
gras_assert0(size >= 0, "Cannot send a negative amount of data");
@@
-194,8
+196,8
@@
gras_trp_file_chunk_send(gras_socket_t *sock,
while (size) {
int status = 0;
while (size) {
int status = 0;
- DEBUG3("write(%d, %p, %ld);", sock->sd, data, (
size_
t)size);
- status = write(sock->sd, data, (
size_
t)size);
+ DEBUG3("write(%d, %p, %ld);", sock->sd, data, (
long in
t)size);
+ status = write(sock->sd, data, (
long in
t)size);
if (status == -1) {
RAISE4(system_error,"write(%d,%p,%d) failed: %s",
if (status == -1) {
RAISE4(system_error,"write(%d,%p,%d) failed: %s",
@@
-221,7
+223,7
@@
gras_trp_file_chunk_send(gras_socket_t *sock,
gras_error_t
gras_trp_file_chunk_recv(gras_socket_t *sock,
char *data,
gras_error_t
gras_trp_file_chunk_recv(gras_socket_t *sock,
char *data,
-
size_
t size) {
+
long in
t size) {
gras_assert0(sock, "Cannot recv on an NULL socket");
gras_assert0(sock->incoming, "Cannot recv on client file socket");
gras_assert0(sock, "Cannot recv on an NULL socket");
gras_assert0(sock->incoming, "Cannot recv on client file socket");
@@
-230,7
+232,7
@@
gras_trp_file_chunk_recv(gras_socket_t *sock,
while (size) {
int status = 0;
while (size) {
int status = 0;
- status = read(sock->sd, data, (
size_
t)size);
+ status = read(sock->sd, data, (
long in
t)size);
DEBUG3("read(%d, %p, %ld);", sock->sd, data, size);
if (status == -1) {
DEBUG3("read(%d, %p, %ld);", sock->sd, data, size);
if (status == -1) {