- other ARM enhancements

- fixed missing headers in last utime(2) + fadvise(2) patches
This commit is contained in:
Enrico Scholz 2011-02-20 20:57:53 +01:00
commit d7dfb66cef
2 changed files with 68 additions and 9 deletions

View file

@ -313,14 +313,17 @@ index ca631bc..9334eee 100644
+FUNC_END __aeabi_unwind_cpp_pr0
diff --git a/arm/__fadvise.c b/arm/__fadvise.c
new file mode 100644
index 0000000..0aa1246
index 0000000..c6748c4
--- /dev/null
+++ b/arm/__fadvise.c
@@ -0,0 +1,14 @@
+#include <fcntl.h>
@@ -0,0 +1,17 @@
+#include "syscalls.h"
+
+#ifndef __NR_fadvise64
+#define _LINUX_SOURCE
+#include <fcntl.h>
+#include <unistd.h>
+
+long fadvise64_64(int fd, off64_t offset, off64_t len, int advice)
+{
+ extern long __arm_fadvise64_64(int fd, int advice, off64_t offset, off64_t len);
@ -1234,7 +1237,7 @@ index e7fd3e8..22e3696 100644
"mipsel","-Os","-fomit-frame-pointer","-mno-abicalls","-fno-pic","-G","0",0,
"ppc","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
diff --git a/dietdirent.h b/dietdirent.h
index dbd7206..c9c7127 100644
index dbd7206..3e823f8 100644
--- a/dietdirent.h
+++ b/dietdirent.h
@@ -1,8 +1,12 @@
@ -1247,7 +1250,7 @@ index dbd7206..c9c7127 100644
- char buf[PAGE_SIZE-(sizeof (int)*3)];
unsigned int num;
unsigned int cur;
+ char buf[];
+ char buf[] __attribute__((__aligned__(8)));
}; /* stream data from opendir() */
+
+#define __DIRSTREAM_BUF_SIZE (__DIET_PAGE_SIZE - offsetof(struct __dirstream, buf))
@ -1699,14 +1702,17 @@ index 0000000..24bb220
+#endif
diff --git a/lib/__utime.c b/lib/__utime.c
new file mode 100644
index 0000000..e013265
index 0000000..0e4d0df
--- /dev/null
+++ b/lib/__utime.c
@@ -0,0 +1,18 @@
+#include <utime.h>
@@ -0,0 +1,21 @@
+#include <syscalls.h>
+
+#ifndef __NR_utime
+#define _BSD_SOURCE
+#include <utime.h>
+#include <sys/time.h>
+
+int utime(const char *filename, const struct utimbuf *times)
+{
+ if (times == NULL)
@ -2229,6 +2235,55 @@ index 9682f35..370bec6 100644
static const double coeff[] = { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10 };
int signgam;
diff --git a/librpc/clnt_raw.c b/librpc/clnt_raw.c
index 042d130..1e89ac0 100644
--- a/librpc/clnt_raw.c
+++ b/librpc/clnt_raw.c
@@ -53,7 +53,10 @@ static struct clntraw_private {
CLIENT client_object;
XDR xdr_stream;
char _raw_buf[UDPMSGSIZE];
- char mashl_callmsg[MCALL_MSG_SIZE];
+ union {
+ struct rpc_msg msg;
+ char buf[MCALL_MSG_SIZE];
+ } mashl_call;
unsigned int mcnt;
} *clntraw_private;
@@ -101,7 +104,7 @@ unsigned long vers;
call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
call_msg.rm_call.cb_prog = prog;
call_msg.rm_call.cb_vers = vers;
- xdrmem_create(xdrs, clp->mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE);
+ xdrmem_create(xdrs, clp->mashl_call.buf, MCALL_MSG_SIZE, XDR_ENCODE);
if (!xdr_callhdr(xdrs, &call_msg)) {
perror("clnt_raw.c - Fatal header serialization error.");
}
@@ -145,8 +148,8 @@ struct timeval timeout;
*/
xdrs->x_op = XDR_ENCODE;
XDR_SETPOS(xdrs, 0);
- ((struct rpc_msg *) clp->mashl_callmsg)->rm_xid++;
- if ((!XDR_PUTBYTES(xdrs, clp->mashl_callmsg, clp->mcnt)) ||
+ clp->mashl_call.msg.rm_xid++;
+ if ((!XDR_PUTBYTES(xdrs, clp->mashl_call.buf, clp->mcnt)) ||
(!XDR_PUTLONG(xdrs, (long *) &proc)) ||
(!AUTH_MARSHALL(h->cl_auth, xdrs)) || (!(*xargs) (xdrs, argsp))) {
return (RPC_CANTENCODEARGS);
diff --git a/librpc/clnt_udp.c b/librpc/clnt_udp.c
index ae7f3d8..003edf5 100644
--- a/librpc/clnt_udp.c
+++ b/librpc/clnt_udp.c
@@ -335,7 +335,7 @@ struct timeval utimeout; /* seconds to wait before giving up */
if (inlen < 4)
continue;
/* see if reply transaction id matches sent id */
- if (*((uint32_t *) (cu->cu_inbuf)) != *((uint32_t *) (cu->cu_outbuf)))
+ if (memcmp(cu->cu_inbuf, cu->cu_outbuf, 4) != 0)
continue;
/* we now assume we have the proper reply */
break;
diff --git a/libugly/strftime.c b/libugly/strftime.c
index 56ae082..cf16f37 100644
--- a/libugly/strftime.c