Пример #1
0
static int
usd_FileSeek(usd_handle_t usd, afs_int64 reqOff, int whence,
	     afs_int64 * curOffP)
{
    int fd = (intptr_t)(usd->handle);
    osi_lloff_t lloff;

    if (!osi_hFitsInOff(reqOff))
	return EINVAL;

    lloff = osi_llseek(fd, reqOff, whence);
    if (lloff == (((osi_lloff_t) 0) - 1))
	return errno;
    if (curOffP)
	*curOffP = lloff;

    return 0;
}
Пример #2
0
static int
usd_FileSeek(usd_handle_t usd, afs_hyper_t reqOff, int whence,
	     afs_hyper_t * curOffP)
{
    int fd = (intptr_t)(usd->handle);
    osi_lloff_t lloff;

    if (!osi_hFitsInOff(reqOff, lloff))
	return EINVAL;

    osi_h2off(reqOff, lloff);
    lloff = osi_llseek(fd, lloff, whence);
    if (lloff == (((osi_lloff_t) 0) - 1))
	return errno;
    if (curOffP)
	osi_off2h(lloff, *curOffP);

    return 0;
}