<p></p>
<p><b>@kfessel</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16822#discussion_r714043422">cpu/native/syscalls.c</a>:</p>
<pre style='color:#555'>> +                errno = res;
+                return -1;
</pre>
<p><code>*write</code> should already have set <code>errno</code> -at least in case <code>real_write</code> is called (default)- the return value should not be an ERRNO but according to standard is -1 (in case of failure)</p>

⬇️ Suggested change
<pre style="color: #555">-                errno = res;
-                return -1;
+                return res;
</pre>


<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/16822#discussion_r714047956">cpu/native/syscalls.c</a>:</p>
<pre style='color:#555'>> +                errno = res;
+                return -1;
</pre>
<p><code>return -1</code> would also be ok but in that case we need may have another <code>set return register = -1</code> instruction</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/16822#pullrequestreview-761053118">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYBPMHWEL5ORIWCWKQTUDHXCZANCNFSM5DSRGJIQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/ABE7WYB5NJEQ4DFQ2AOYSTTUDHXCZA5CNFSM5DSRGJI2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOFVOL7PQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/16822#pullrequestreview-761053118",
"url": "https://github.com/RIOT-OS/RIOT/pull/16822#pullrequestreview-761053118",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>