linux kernel 3.8 에서 sys_socket 함수의 body 는 어디에 정의되어 있나요 ?

trymp의 이미지


커널 초보 입니다.

Linux 3.8.13 을 사용하고 있는데요.

sys_socket 함수에 대한 body 를 찾고 있는데, 이 함수의 body 부분이

소스상에서 보이질 않습니다. 아래와 같은 define 문 만 보이고요

__SYSCALL_COMMON(41, sys_socket, sys_socket)

예전 커널에서는 검색하면 함수 body 가 그대로 보였는데,

이 커널 버전에서는 sys_socket() 정의 부분이 어딘지 못 찾겠네요.

이 함수의 body 찾는 방법 좀 알려주세요

bushi의 이미지

socket() 시스템 콜은 argument 를 3개 받습니다.

int socket(int domain, int type, int protocol);

커널 소스에서 "SYSCALL_DEFINE3 *( *socket *," 을 grep 으로 찾아보세요.

-g 옵션을 줘서 컴파일된 커널 elf 파일이 있다면, 좀 더 쉽게 찾을 수 있습니다.

[schoi0@sel-schoi0-d2 git]$ readelf -s vmlinux | grep sys_socket
 97742: 8055a560   204 FUNC    GLOBAL DEFAULT    2 sys_socket
101649: 8004b4c0    28 FUNC    WEAK   DEFAULT    2 sys_socketcall
101686: 8004b4c0    28 FUNC    WEAK   DEFAULT    2 compat_sys_socketcall
111414: 8055a62c   476 FUNC    GLOBAL DEFAULT    2 sys_socketpair
[schoi0@sel-schoi0-d2 git]$ 
[schoi0@sel-schoi0-d2 git]$ addr2line 8055a560 -e vmlinux
/work/Visteon/wr_5_0/devprofile/tmp/work/eagle_imx6-oe-linux-gnueabi/linux-imx/3.10.17-r3/git/net/socket.c:1360
[schoi0@sel-schoi0-d2 git]$
익명 사용자의 이미지

검색하실 때는 윗 분 말씀처럼 시스템 콜의 인자로 검색하시면 됩니다.
저 같은 경우는 보통 아래와 같이 찾습니다.

[root@localhost linux-3.17.1]# grep -rn 'SYSCALL_DEFINE3(socket' .
./net/socket.c:1379:SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol)

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.