aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/main.c1
-rw-r--r--linux-user/syscall.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 150a356e8d..f8a8764ae9 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -17,6 +17,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
+#include "qemu-version.h"
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/resource.h>
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index bd8095c819..71ccbd9c5e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -914,7 +914,7 @@ static inline abi_long copy_from_user_fdset(fd_set *fds,
int i, nw, j, k;
abi_ulong b, *target_fds;
- nw = (n + TARGET_ABI_BITS - 1) / TARGET_ABI_BITS;
+ nw = DIV_ROUND_UP(n, TARGET_ABI_BITS);
if (!(target_fds = lock_user(VERIFY_READ,
target_fds_addr,
sizeof(abi_ulong) * nw,
@@ -961,7 +961,7 @@ static inline abi_long copy_to_user_fdset(abi_ulong target_fds_addr,
abi_long v;
abi_ulong *target_fds;
- nw = (n + TARGET_ABI_BITS - 1) / TARGET_ABI_BITS;
+ nw = DIV_ROUND_UP(n, TARGET_ABI_BITS);
if (!(target_fds = lock_user(VERIFY_WRITE,
target_fds_addr,
sizeof(abi_ulong) * nw,