Sockets services: Difference between revisions

No edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 22: Line 22:
| 0  || [[#RegisterClient]]
| 0  || [[#RegisterClient]]
|-
|-
| 1  || StartMonitoring
| 1  || [[#StartMonitoring]]
|-
|-
| 2  || [[#Socket]]
| 2  || [[#Socket]]
Line 91: Line 91:
|-
|-
| 35 || [17.0.0+] NifIoctl
| 35 || [17.0.0+] NifIoctl
|-
| 36 || [18.0.0+]
|-
| 37 || [18.0.0+]
|-
| 38 || [18.0.0+]
|-
| 39 || [20.0.0+]
|-
| 40 || [20.0.0+]
|-
| 41 || [21.0.0+]
|-
| 42 || [21.0.0+]
|-
| 43 || [21.0.0+]
|-
|-
| 200 || [15.0.0+] SetThreadCoreMask
| 200 || [15.0.0+] SetThreadCoreMask
Line 98: Line 114:


== RegisterClient ==
== RegisterClient ==
Takes a [[#LibraryConfigData]], the PID, the size of the transfer memory and a copy-handle of the latter.
Takes a [[#LibraryConfigData]], the PID, the size of the transfer memory and a copy-handle of the latter. Returns 4-bytes of output.


The transfer memory must be larger than a the computed size below. Should the transfer memory be smaller than that, the BSD sockets service would only send ZeroWindow packets (for TCP), resulting in a transfer rate not exceeding 1 byte/s.
The transfer memory must be larger than a the computed size below. Should the transfer memory be smaller than that, the BSD sockets service would only send ZeroWindow packets (for TCP), resulting in a transfer rate not exceeding 1 byte/s.
Line 111: Line 127:
     return (size_t)(config->sb_efficiency * sum);
     return (size_t)(config->sb_efficiency * sum);
  }
  }
== StartMonitoring ==
Takes a PID and an u64 pid_reserved, no output.
This is used after the RegisterClient* cmd by the user-process.


== Socket ==
== Socket ==
Line 160: Line 181:


== RegisterResourceStatisticsName ==
== RegisterResourceStatisticsName ==
With [10.0.0+] this now takes an additional 8-bytes of input.
[10.0.0+] Now takes an additional 8-bytes of input.


== RegisterClientShared ==
== RegisterClientShared ==
Line 168: Line 189:


sdknso will only use this cmd when two flags in the input config are set: the first one being set indicates that the bsd:s service is used, while the second flag enables using this cmd. An error is thrown if the work-buffer size is <0x1000. Otherwise when these flags aren't set, [[#RegisterClient]] is used as usual.
sdknso will only use this cmd when two flags in the input config are set: the first one being set indicates that the bsd:s service is used, while the second flag enables using this cmd. An error is thrown if the work-buffer size is <0x1000. Otherwise when these flags aren't set, [[#RegisterClient]] is used as usual.
== Cmd36 ==
Takes a PID, an input u32 [[#LibraryConfigData|version]], an u64 pid_reserved, returns 4-bytes of output.
On NX this is stubbed, just returns 0.
On Ounce this is used as a new version of RegisterClient*, when initializing bsd:s/bsd:a.
== Cmd38 ==
Takes 4-bytes of input and a type-0x21 input buffer. Returns a total of 8-bytes of output.
On NX this just returns Result 0 and writes an error to output.
== Cmd39 ==
[21.0.0+] Now no longer returns two output handles.
On NX this writes errors to output.
== Cmd41 ==
On NX this writes errors to output.


= bsdcfg, ifcfg =
= bsdcfg, ifcfg =
Line 724: Line 765:
| [19.0.0+] || 0xA
| [19.0.0+] || 0xA
|}
|}
On NX the upper u16 of the version is 0x0, while on Ounce it's 0x1.


= DeleteMode =
= DeleteMode =