NHỮNG CÂU HỎI THƯỜNG GẶP VỀ LINUX - Trang 59

Những câu hỏi thường gặp về Linux

Replace the references to

getty

(or

mingetty

or

uugetty

or whatever) in [/etc/inittab] with

references to

/sbin/mygetty

.

#!/bin/sh setterm -fore yellow -bold on -back blue -store > $1

exec /sbin/mingetty $@

H:

Làm thế nào để dùng trên 128Mb Swap

Đ:

Use several swap partitions or swap files. Linux kernels before version 2.2 supported up to 16 swap

areas, each of up to 128Mb. Recent versions do not have this limitation.

Very old kernels only supported swap partition sizes up to 16Mb.

Linux on machines with 8KB paging, like Alpha và Sparc64, support a swap partition up to 512MB.
The 128MB limitation comes from

PAGE_SIZE*BITSPERBYTE

on machines with 4KB paging, but is

512KB on machines with 8KB paging. The limit is due to the use of a single page allocation map.

The file [mm/swapfile.c] has all of the gory details.

H:

Làm thế nào để tránh lổi khi liên kết chương trình với các hàm toán học

Đ:

Older run-time libraries included the math library in the C run-time library. It was not necessary to

specify the math library separately when compiling. If the compiler generates a message like this when
linking a program that uses math functions:

/tmp/ccDUQM4J.o: In function ‘main’:

/tmp/ccDUQM4J.o(.text+0x19): undefined reference to ‘sqrt’

collect2: ld returned 1 exit status

You need use the

-lm

option with GCC to link with the math libraries:

# gcc -o program program.c -lm

Make sure also to use the statement

#include

<math.h>

in the source file.

Florian Schmidt

58

Liên Kết Chia Sẽ

** Đây là liên kết chia sẻ bới cộng đồng người dùng, chúng tôi không chịu trách nhiệm gì về nội dung của các thông tin này. Nếu có liên kết nào không phù hợp xin hãy báo cho admin.