diff options
author | Björn Gustavsson <[email protected]> | 2011-12-09 12:33:08 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-12-09 12:33:08 +0100 |
commit | 7bd353a976a0bf4d93b962376daa0d38958335d0 (patch) | |
tree | 2fac432e0077eed23aa4df31500928628628b362 /erts/emulator/drivers/common/efile_drv.c | |
parent | 4a7dfc9733d8af85955baefc79bcff7d72971d68 (diff) | |
parent | deca218163838f88ade8f62eca60d8d67db00f0d (diff) | |
download | otp-7bd353a976a0bf4d93b962376daa0d38958335d0.tar.gz otp-7bd353a976a0bf4d93b962376daa0d38958335d0.tar.bz2 otp-7bd353a976a0bf4d93b962376daa0d38958335d0.zip |
Merge branch 'raimo/64-bit-driver-api/OTP-9795'
* raimo/64-bit-driver-api/OTP-9795: (22 commits)
driver_SUITE.erl: Fix sys info drivers
emulator test drivers: Conform to updated driver API
runtime_tools's drivers: Conform to updated driver API
ws's xwe_driver.c: Conform to updated driver API
megaco's flex scanner: Conform to updated driver API
seq_trace_SUITE_data/echo_drv.c: Conform to updated driver API
erl_interface tests: Conform port_call_drv.c updated driver API
erl_drv_thread_SUITE_data/testcase_driver.c: Conform to updated driver API
float_SUITE_data/fp_drv.c: Conform to updated driver API
port_SUITE_data/*_drv.c: Conform to updated driver API
port_bif_SUITE_data/control_drv.c: Conform to updated driver API
send_term_SUITE_data/send_term_drv.c: Conform to updated driver API
system_profile_SUITE_data/echo_drv.c: Conform to updated driver API
trace_port_SUITE_data/echo_drv.c: Conform to updated driver API
Remove support for old drivers without ERL_DRV_EXTENDED_MARKER
built-in drivers: Add ERL_DRV_EXTENDED_MARKER and version numbers
Bump driver version to 2.0
erl_driver.h: Enlarge type on return value from call
erl_driver.h: Enlarge types on driver callbacks output, control and call
erl_driver.h: Enlarge types in driver output functions
...
Conflicts:
erts/emulator/test/driver_SUITE_data/monitor_drv.c
erts/emulator/test/driver_SUITE_data/timer_drv.c
Diffstat (limited to 'erts/emulator/drivers/common/efile_drv.c')
-rw-r--r-- | erts/emulator/drivers/common/efile_drv.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c index d9282dbb12..b132991a3b 100644 --- a/erts/emulator/drivers/common/efile_drv.c +++ b/erts/emulator/drivers/common/efile_drv.c @@ -241,9 +241,10 @@ typedef unsigned char uchar; static ErlDrvData file_start(ErlDrvPort port, char* command); static int file_init(void); static void file_stop(ErlDrvData); -static void file_output(ErlDrvData, char* buf, int len); -static int file_control(ErlDrvData, unsigned int command, - char* buf, int len, char **rbuf, int rlen); +static void file_output(ErlDrvData, char* buf, ErlDrvSizeT len); +static ErlDrvSSizeT file_control(ErlDrvData, unsigned int command, + char* buf, ErlDrvSizeT len, + char **rbuf, ErlDrvSizeT rlen); static void file_timeout(ErlDrvData); static void file_outputv(ErlDrvData, ErlIOVec*); static void file_async_ready(ErlDrvData, ErlDrvThreadData); @@ -1083,7 +1084,7 @@ static void invoke_read_line(void *data) d->c.read_line.read_offset - d->c.read_line.read_size; if (size == 0) { /* Need more place */ - size_t need = (d->c.read_line.read_size >= DEFAULT_LINEBUF_SIZE) ? + ErlDrvSizeT need = (d->c.read_line.read_size >= DEFAULT_LINEBUF_SIZE) ? d->c.read_line.read_size + DEFAULT_LINEBUF_SIZE : DEFAULT_LINEBUF_SIZE; ErlDrvBinary *newbin = driver_alloc_binary(need); if (newbin == NULL) { @@ -2291,7 +2292,7 @@ file_async_ready(ErlDrvData e, ErlDrvThreadData data) * Driver entry point -> output */ static void -file_output(ErlDrvData e, char* buf, int count) +file_output(ErlDrvData e, char* buf, ErlDrvSizeT count) { file_descriptor* desc = (file_descriptor*)e; Efile_error errInfo; /* The error codes for the last operation. */ @@ -2668,9 +2669,9 @@ file_flush(ErlDrvData e) { /********************************************************************* * Driver entry point -> control */ -static int +static ErlDrvSSizeT file_control(ErlDrvData e, unsigned int command, - char* buf, int len, char **rbuf, int rlen) { + char* buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen) { /* * warning: variable ‘desc’ set but not used * [-Wunused-but-set-variable] @@ -2971,8 +2972,8 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) { cq_enq(desc, d); } goto done; case FILE_WRITE: { - int skip = 1; - int size = ev->size - skip; + ErlDrvSizeT skip = 1; + ErlDrvSizeT size = ev->size - skip; if (lseek_flush_read(desc, &err) < 0) { reply_posix_error(desc, err); goto done; @@ -2981,7 +2982,7 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) { reply_posix_error(desc, EBADF); goto done; } - if (size <= 0) { + if (size == 0) { reply_Uint(desc, size); goto done; } @@ -3095,7 +3096,7 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) { EF_FREE(d); reply_Uint(desc, 0); } else { - size_t skip = 1 + 4 + 8*(2*n); + ErlDrvSizeT skip = 1 + 4 + 8*(2*n); if (skip + total != ev->size) { /* Actual amount of data does not match * total of all pos/size specs |