2010-01-26 02:00:09     mlockall()函数问题

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2010-01-26 02:00:09     mlockall()函数问题

zhang zhihua (CHINA)

Message: 85110   

 

我编了一个小程序,其中用到mlockall(MCL_CURRENT | MCL_FUTURE)的调用,我包含了头文件#include(sys/mman.h),但是在编译的时候总是提示undefined!Makefile文件如下:

 

XENO_PATH = /home/uClinux-dist/staging/usr

CFLAGS = -I$(XENO_PATH)/include -I/usr/include/

LDFLAGS = -L$(XENO_PATH)/lib -Wl,-elf2flt

 

CC =bfin-uclinux-gcc

 

LDLIBS += -lnative -lm -lpthread

 

EXEC=test

OBJS=test.o

 

all:$(EXEC)

$(EXEC):$(OBJS)

$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)

 

为什么呢?

TranslateQuoteReplyEditDelete

 

 

2010-01-26 02:11:05     Re: mlockall()函数问题

Mike Frysinger (UNITED STATES)

Message: 85111   

 

mlockall() makes no sense on a system that lacks virtual memory -- the memory is always going to be locked.  dont use the function.

QuoteReplyEditDelete

 

 

2010-01-26 02:24:24     Re: mlockall()函数问题

zhang zhihua (CHINA)

Message: 85112   

 

OK!Thank you,Mike!

Attachments

    Outcomes