Original link : https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_MRG/1.2/html/Realtime_Reference_Guide/sect-Realtime_Reference_Guide-Using_library_calls_to_set_priority-sched_get_priority_min_and_sched_get_priority_max.html


#include <stdio.h>
#include <unistd.h>
#include <sched.h>

main()
{


  printf("Valid priority range for SCHED_OTHER: %d - %d\n",
  sched_get_priority_min(SCHED_OTHER),
  sched_get_priority_max(SCHED_OTHER));

  printf("Valid priority range for SCHED_FIFO: %d - %d\n",
  sched_get_priority_min(SCHED_FIFO),
  sched_get_priority_max(SCHED_FIFO));

  printf("Valid priority range for SCHED_RR: %d - %d\n",
  sched_get_priority_min(SCHED_RR),
  sched_get_priority_max(SCHED_RR));
}


Output

Valid priority range for SCHED_OTHER: 0 - 0

Valid priority range for SCHED_FIFO: 1 - 99

Valid priority range for SCHED_RR: 1 - 99



저작자 표시 비영리 동일 조건 변경 허락
신고

'Programming > linux왕초보' 카테고리의 다른 글

pthread min, max priority on linux  (0) 2017.06.12
use vim like as source insight  (0) 2016.04.06
[ubuntu] change default shell  (0) 2016.03.22
GDB를 사용한 CORE 파일의 분석  (0) 2016.02.05
kernel make menuconfig error  (0) 2016.01.21
Caching your GitHub password in Git  (0) 2016.01.08
Serial ports usage on Linux  (0) 2016.01.08
process 종료  (0) 2015.05.28
fork  (0) 2015.05.26
Linux SSD 최적화  (0) 2015.04.17
fflush, fileno  (0) 2015.04.07
Posted by bluelimn

original link : http://techqa.info/programming/question/28285850/Opensuse-13-1-build-envsetup-sh--syntax-error-near-unexpected-token------r--



Error:

bash: build/envsetup.sh: line 1: syntax error near unexpected token $'{\r'' 'ash: build/envsetup.sh: line 1:function hmm() {


Solve:

The problem comes from Windows end-of-lines (EOL) so you'll have to convert all scripts to unix-style EOL through dos2unix (run apt-get install dos2unix on Ubuntu) and then convert your scripts:

dos2unix build/envsetup.sh sdk/bash_completion/adb.bash

Then all vendorsetup.sh (that will prevent the "command not found" error you get):

find device/ -name vendorsetup.sh -exec dos2unix {} \;

And one last to run the choosecombo script:

dos2unix build/core/find-jdk-tools-jar.sh

EDIT: In order to finish the overall compilation, the exhaustive conversion:

find . -name '*.sh' -exec dos2unix {} \;
find . -name '*.py' -exec dos2unix {} \;
find . -name '*.c' -exec dos2unix {} \;
find . -name '*.h' -exec dos2unix {} \;
find . -name '*.cpp' -exec dos2unix {} \;
find . -name '*.hpp' -exec dos2unix {} \;
find . -name '*.txt' -exec dos2unix {} \;
find . -name 'Config.in' -exec dos2unix {} \;
find . -name 'Config.src' -exec dos2unix {} \;
find . -name 'Makefile' -exec dos2unix {} \;
find . -name 'mkmakefile' -exec dos2unix {} \;
find . -name 'Kconfig*' -exec dos2unix {} \;
find . -name rmtypedefs -exec dos2unix {} \;
find . -name apicheck -exec dos2unix {} \;
find . -name seapp_contexts -exec dos2unix {} \;
dos2unix external/busybox/scripts/* external/busybox/applets/* kernel/scripts/* dalvik/dx/etc/* prebuilts/sdk/tools/*

The *.sh for all shell scripts, and *.py for all python scripts (used during make compilation), as well as .c and .cpp file (obviously) and other files used by makefiles.

Of course you could go the over-overkill find . -type f -exec dos2unix -s -k -o {} \; and let dos2unix decide which files are text and which are binary.

There might be other. I'll edit this answer as I find new ones...

저작자 표시 비영리 동일 조건 변경 허락
신고
Posted by bluelimn

bluelimn

달력

최근에 달린 댓글

최근에 받은 트래백

글보관함


티스토리 툴바