Colin Ian King has proposed merging
lp:~colin-king/apparmor/fix-arm64-test-builds into lp:apparmor.
Requested reviews:
AppArmor Developers (apparmor-dev)
For more details, see:
https://code.launchpad.net/~colin-king/apparmor/fix-arm64-test-builds/+merge/321876
This fixes build issues for the readdir test for arm64 where getdents(2) is not
wired up as a system call but gendents64(2) is available. This changes the
preference to use the 64 bit system call by default if it is available on 64
bit systems.
--
Your team AppArmor Developers is requested to review the proposed merge of
lp:~colin-king/apparmor/fix-arm64-test-builds into lp:apparmor.
=== modified file 'tests/regression/apparmor/readdir.c'
--- tests/regression/apparmor/readdir.c 2010-12-20 20:29:10 +0000
+++ tests/regression/apparmor/readdir.c 2017-04-04 15:15:48 +0000
@@ -6,6 +6,7 @@
* published by the Free Software Foundation, version 2 of the
* License.
*/
+#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
@@ -20,7 +21,11 @@
int main(int argc, char *argv[])
{
int fd;
+#if defined(SYS_getdents64)
+ struct dirent64 dir;
+#else
struct dirent dir;
+#endif
if (argc != 2){
fprintf(stderr, "usage: %s dir\n",
@@ -42,7 +47,11 @@
*/
/* getdents isn't exported by glibc, so must use syscall() */
+#if defined(SYS_getdents64)
+ if (syscall(SYS_getdents64, fd, &dir, sizeof(struct dirent64)) == -1){
+#else
if (syscall(SYS_getdents, fd, &dir, sizeof(struct dirent)) == -1){
+#endif
printf("FAIL - getdents %s\n", strerror(errno));
return 1;
}
--
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/apparmor