Make stuff build on openbsd
arch/alpha/alpha_tru64_process.cc: So, I don't know why linux uses an off_t here. I'm also not sure why linux defines an off_t to be a long Let's just use long here since it works for linux, and that's what bsd does base/inifile.cc: correct #include for OpenBSD dev/disk_image.cc: the correct type for this is streampos --HG-- extra : convert_revision : f3ac3a3b8515d66e07ffb9780d8a9e387297b6a0
This commit is contained in:
parent
888ea0dfd9
commit
255ac8372d
|
@ -629,7 +629,7 @@ class Tru64 {
|
||||||
// just pass basep through uninterpreted.
|
// just pass basep through uninterpreted.
|
||||||
TypedBufferArg<int64_t> basep(tgt_basep);
|
TypedBufferArg<int64_t> basep(tgt_basep);
|
||||||
basep.copyIn(xc->mem);
|
basep.copyIn(xc->mem);
|
||||||
::off_t host_basep = (off_t)*basep;
|
long host_basep = (off_t)*basep;
|
||||||
int host_result = getdirentries(fd, host_buf, tgt_nbytes, &host_basep);
|
int host_result = getdirentries(fd, host_buf, tgt_nbytes, &host_basep);
|
||||||
|
|
||||||
// check for error
|
// check for error
|
||||||
|
|
|
@ -35,6 +35,9 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
|
#if defined(__OpenBSD__)
|
||||||
|
#include <libgen.h>
|
||||||
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
|
@ -109,7 +109,7 @@ RawDiskImage::read(uint8_t *data, off_t offset) const
|
||||||
if (stream.seekg(offset * SectorSize, ios::beg) < 0)
|
if (stream.seekg(offset * SectorSize, ios::beg) < 0)
|
||||||
panic("Could not seek to location in file");
|
panic("Could not seek to location in file");
|
||||||
|
|
||||||
off_t pos = stream.tellg();
|
streampos pos = stream.tellg();
|
||||||
stream.read((char *)data, SectorSize);
|
stream.read((char *)data, SectorSize);
|
||||||
|
|
||||||
DPRINTF(DiskImageRead, "read: offset=%d\n", (uint64_t)offset);
|
DPRINTF(DiskImageRead, "read: offset=%d\n", (uint64_t)offset);
|
||||||
|
@ -136,7 +136,7 @@ RawDiskImage::write(const uint8_t *data, off_t offset)
|
||||||
DPRINTF(DiskImageWrite, "write: offset=%d\n", (uint64_t)offset);
|
DPRINTF(DiskImageWrite, "write: offset=%d\n", (uint64_t)offset);
|
||||||
DDUMP(DiskImageWrite, data, SectorSize);
|
DDUMP(DiskImageWrite, data, SectorSize);
|
||||||
|
|
||||||
off_t pos = stream.tellp();
|
streampos pos = stream.tellp();
|
||||||
stream.write((const char *)data, SectorSize);
|
stream.write((const char *)data, SectorSize);
|
||||||
return stream.tellp() - pos;
|
return stream.tellp() - pos;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue