/* -------------------------
*/
-static int setforkmode(struct adouble *adp, int eid, int ofrefnum, int what)
+static int setforkmode(struct adouble *adp, int eid, int ofrefnum, off_t what)
{
return ad_lock(adp, eid, ADLOCK_RD | ADLOCK_FILELOCK, what, 1, ofrefnum);
}
/* -------------------------
*/
-int getforkmode(struct adouble *adp, int eid, int what)
+int getforkmode(struct adouble *adp, int eid, off_t what)
{
return ad_testlock(adp, eid, what);
}
/* in fork.c */
extern int flushfork (struct ofork *);
-extern int getforkmode (struct adouble *, int , int );
+extern int getforkmode (struct adouble *, int , off_t );
/* FP functions */
int afp_openfork (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen);
*/
struct ad_entry {
- u_int32_t ade_off;
- u_int32_t ade_len;
+ off_t ade_off;
+ ssize_t ade_len;
};
typedef struct adf_lock_t {
/* synchronization locks */
#define AD_FILELOCK_BASE (0x80000000)
#else
+#if _FILE_OFFSET_BITS == 64
+#define AD_FILELOCK_BASE (0x7FFFFFFFFFFFFFFFULL - 9)
+#else
#define AD_FILELOCK_BASE (0x7FFFFFFF -9)
#endif
+#endif
/* FIXME:
* AD_FILELOCK_BASE case
#endif /* HAVE_CONFIG_H */
#include <atalk/adouble.h>
+#include <atalk/logger.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+#include <inttypes.h>
#include <string.h>
translate a data fork lock to an offset
*/
-static off_t df2off(int off)
+static off_t df2off(off_t off)
{
-int start = off;
+ off_t start = off;
if (off == AD_FILELOCK_OPEN_WR)
start = LOCK_DATA_WR;
else if (off == AD_FILELOCK_OPEN_RD)
translate a resource fork lock to an offset
*/
-static off_t hf2off(int off)
+static off_t hf2off(off_t off)
{
-int start = off;
+ off_t start = off;
if (off == AD_FILELOCK_OPEN_WR)
start = LOCK_RSRC_WR;
else if (off == AD_FILELOCK_OPEN_RD)