aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo_ipc.c
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2011-03-25 12:38:43 -0500
committerPeter Seebach <peter.seebach@windriver.com>2011-03-25 12:38:43 -0500
commit29e8b8a4cd8f7383c3d851b6255272f1c2a5d286 (patch)
treec9619032a670d06124ef45c392484f4a04f7d0f0 /pseudo_ipc.c
parent96d8e7ce8b483e5cafd0449b9735e4714f41f20b (diff)
downloadpseudo-29e8b8a4cd8f7383c3d851b6255272f1c2a5d286.tar.gz
pseudo-29e8b8a4cd8f7383c3d851b6255272f1c2a5d286.tar.bz2
pseudo-29e8b8a4cd8f7383c3d851b6255272f1c2a5d286.zip
Merge in ports work
This is a spiffied-up rebase of a bunch of intermediate changes, presented as a whole because it is, surprisingly, less confusing that way. The basic idea is to separate the guts code into categories ranging from generic stuff that can be the same everywhere and specific variants. The big scary one is the Darwin support, which actually seems to run okay on 64-bit OS X 10.6. (No other variants were tested.) The other example given is support for the old clone() syscall on RHEL 4, which affects some wrlinux use cases. There's a few minor cleanup bits here, such as a function with inconsistent calling conventions, but nothing really exciting.
Diffstat (limited to 'pseudo_ipc.c')
-rw-r--r--pseudo_ipc.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/pseudo_ipc.c b/pseudo_ipc.c
index 61e00b8..341c647 100644
--- a/pseudo_ipc.c
+++ b/pseudo_ipc.c
@@ -220,7 +220,7 @@ pseudo_msg_new(size_t pathlen, const char *path) {
*/
void
-pseudo_msg_stat(pseudo_msg_t *msg, const struct stat64 *buf) {
+pseudo_msg_stat(pseudo_msg_t *msg, const PSEUDO_STATBUF *buf) {
if (!msg || !buf)
return;
msg->uid = buf->st_uid;
@@ -233,7 +233,7 @@ pseudo_msg_stat(pseudo_msg_t *msg, const struct stat64 *buf) {
}
void
-pseudo_stat_msg(struct stat64 *buf, const pseudo_msg_t *msg) {
+pseudo_stat_msg(PSEUDO_STATBUF *buf, const pseudo_msg_t *msg) {
if (!msg || !buf)
return;
buf->st_uid = msg->uid;
@@ -242,3 +242,23 @@ pseudo_stat_msg(struct stat64 *buf, const pseudo_msg_t *msg) {
buf->st_rdev = msg->rdev;
}
+#if PSEUDO_STATBUF_64
+void
+pseudo_msg_stat_plain(pseudo_msg_t *msg, const struct stat *buf) {
+ PSEUDO_STATBUF buf64;
+ if (buf) {
+ pseudo_stat64_from32(&buf64, buf);
+ pseudo_msg_stat(msg, &buf64);
+ }
+}
+
+void
+pseudo_stat_msg_plain(struct stat *buf, const pseudo_msg_t *msg) {
+ PSEUDO_STATBUF buf64;
+ if (buf) {
+ pseudo_stat64_from32(&buf64, buf);
+ pseudo_stat_msg(&buf64, msg);
+ pseudo_stat32_from64(buf, &buf64);
+ }
+}
+#endif