EMILE/libemile/emile_second_get_buffer_size.c

28 lines
506 B
C
Raw Normal View History

2004-12-14 23:49:59 +00:00
static __attribute__((used)) char* rcsid = "$CVSHeader$";
/*
*
* (c) 2004 Laurent Vivier <LaurentVivier@wanadoo.fr>
*
*/
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include "libemile.h"
#include "emile.h"
int emile_second_get_buffer_size(int fd, u_int32_t *buffer_size)
{
emile_l2_header_t header;
int ret;
ret = read(fd, &header, sizeof(header));
if (ret != sizeof(header))
return EEMILE_CANNOT_READ_SECOND;
*buffer_size = read_long(&header.kernel_size);
return 0;
}