Skip to main content
deleted 1 character in body
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 263

In my understanding, POSIX only specifies a set of APIs that the OS needs to provide, but it doesn’t specify the implementation detail, specifically the assembly level compatibility. For example, on x86, you need to use a syscall to get the POSIX API:

1. set `eax` to the syscall number
2. set syscall arguments
3. call int 0x80

But this process can vary a lot depending on:

  1. UNIX OS: different OS can have a different mapping from syscall number to POSIX API
  2. architecture: X86/arm have different instructions to call int 0x80

So I think that POSIX does its job by keeping the API conversion for the POSIX library in different OS.e e.g. glibc.so:

The POSIX API is provided as glibc symbolsymbols. So everyEvery time the executable calls the POSIX API, it find sthefinds the symbol in every OS's glibc.so and there is no need to call int 0x80 directly in the executable.

So my question is:

  1. is my understanding correct?
  2. besides glibc.so, are there any other libraries which act like glibc.so but in different UNIX OS?

In my understanding, POSIX only specifies a set of APIs that the OS needs to provide, but it doesn’t specify the implementation detail, specifically the assembly level compatibility. For example, on x86, you need to use a syscall to get the POSIX API:

1. set `eax` to the syscall number
2. set syscall arguments
3. call int 0x80

But this process can vary a lot depending on:

  1. UNIX OS: different OS can have a different mapping from syscall number to POSIX API
  2. architecture: X86/arm have different instructions to call int 0x80

So I think that POSIX does its job by keeping the API conversion for the POSIX library in different OS.e.g. glibc.so:

The POSIX API is provided as glibc symbol. So every time the executable calls the POSIX API, it find sthe symbol in every OS's glibc.so and there is no need to call int 0x80 directly in the executable.

So my question is:

  1. is my understanding correct?
  2. besides glibc.so, are there any other libraries which act like glibc.so but in different UNIX OS?

In my understanding, POSIX only specifies a set of APIs that the OS needs to provide, but it doesn’t specify the implementation detail, specifically the assembly level compatibility. For example, on x86, you need to use a syscall to get the POSIX API:

1. set `eax` to the syscall number
2. set syscall arguments
3. call int 0x80

But this process can vary a lot depending on:

  1. UNIX OS: different OS can have a different mapping from syscall number to POSIX API
  2. architecture: X86/arm have different instructions to call int 0x80

So I think that POSIX does its job by keeping the API conversion for the POSIX library in different OS. e.g. glibc.so:

The POSIX API is provided as glibc symbols. Every time the executable calls the POSIX API, it finds the symbol in every OS's glibc.so and there is no need to call int 0x80 directly in the executable.

So my question is:

  1. is my understanding correct?
  2. besides glibc.so, are there any other libraries which act like glibc.so but in different UNIX OS?
minor fixes
Source Link
terdon
  • 252.2k
  • 69
  • 480
  • 718

How executable usesdo executables use POSIX to keep campatiblecompatibility between different UNIX systemsystems?

In my understanding, POSIX only specifies a set of APIs that the OS needs to provide. But, but it doesn’t specify the implementation detail, specifically the assembleassembly level compatibility. For example, on x86, you need to use a syscall to get the POSIX API:

1. set `eax` to the syscall number
2. set syscall arguments
3. call int 0x80

But this process can vary a lot depending on:

  1. UNIX OS: different OS can have a different mapping from syscall number to POSIX API
  2. architecture: X86/arm have different instructions to call int 0x80

So I think that POSIX does its job by keeping the API conversion for the POSIX library in different OS.e.g. glibc.so:

theThe POSIX API is provided as glibc symbol. So every time the executable calls the POSIX API, it find thesthe symbol in every OS's glibc.soglibc.so and there is no need to call int 0x80 directly in the executable.

So my question is:

  1. is my understanding correct?
  2. besides glibc.so, are there any other librarylibraries which act as the same as glibc.solike glibc.so but in different UNIX OS?

How executable uses POSIX to keep campatible between different UNIX system?

In my understanding, POSIX only specifies a set of APIs that OS needs to provide. But it doesn’t specify the implementation detail, specifically the assemble level compatibility. For example, on x86, you need to use syscall to get the POSIX API:

1. set `eax` to the syscall number
2. set syscall arguments
3. call int 0x80

But this process can vary a lot depending on:

  1. UNIX OS: different OS can have a different mapping from syscall number to POSIX API
  2. architecture: X86/arm have different instructions to call int 0x80

So I think that POSIX does its job by keeping the API conversion for the POSIX library in different OS.e.g. glibc.so:

the POSIX API is provided as glibc symbol. So every time the executable calls the POSIX API, it find the symbol in every OS's glibc.so and no need to call int 0x80 directly in the executable.

So my question is:

  1. is my understanding correct?
  2. besides glibc.so, are there any other library act as the same as glibc.so but in different UNIX OS?

How do executables use POSIX to keep compatibility between different UNIX systems?

In my understanding, POSIX only specifies a set of APIs that the OS needs to provide, but it doesn’t specify the implementation detail, specifically the assembly level compatibility. For example, on x86, you need to use a syscall to get the POSIX API:

1. set `eax` to the syscall number
2. set syscall arguments
3. call int 0x80

But this process can vary a lot depending on:

  1. UNIX OS: different OS can have a different mapping from syscall number to POSIX API
  2. architecture: X86/arm have different instructions to call int 0x80

So I think that POSIX does its job by keeping the API conversion for the POSIX library in different OS.e.g. glibc.so:

The POSIX API is provided as glibc symbol. So every time the executable calls the POSIX API, it find sthe symbol in every OS's glibc.so and there is no need to call int 0x80 directly in the executable.

So my question is:

  1. is my understanding correct?
  2. besides glibc.so, are there any other libraries which act like glibc.so but in different UNIX OS?
Became Hot Network Question
Source Link

How executable uses POSIX to keep campatible between different UNIX system?

In my understanding, POSIX only specifies a set of APIs that OS needs to provide. But it doesn’t specify the implementation detail, specifically the assemble level compatibility. For example, on x86, you need to use syscall to get the POSIX API:

1. set `eax` to the syscall number
2. set syscall arguments
3. call int 0x80

But this process can vary a lot depending on:

  1. UNIX OS: different OS can have a different mapping from syscall number to POSIX API
  2. architecture: X86/arm have different instructions to call int 0x80

So I think that POSIX does its job by keeping the API conversion for the POSIX library in different OS.e.g. glibc.so:

the POSIX API is provided as glibc symbol. So every time the executable calls the POSIX API, it find the symbol in every OS's glibc.so and no need to call int 0x80 directly in the executable.

So my question is:

  1. is my understanding correct?
  2. besides glibc.so, are there any other library act as the same as glibc.so but in different UNIX OS?