# POSIX link\(\) syscall only takes two arguments \(no flags\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/4d6429fc4fd299cdfb2256d4aac87bc6551ba09e)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 4d6429fc4fd299cdfb2256d4aac87bc6551ba09e

Requested commit: 4d6429fc4fd299cdfb2256d4aac87bc6551ba09e

Commit: 4d6429fc4fd299cdfb2256d4aac87bc6551ba09e

Tree: 8b7de21ad01c27119b19a0b18b0cf962f418c985

Author: Pat Tullmann

Committer: Andrew Kelley

## Message

```
POSIX link() syscall only takes two arguments (no flags)

The signature is documented as:

   int link(const char *, const char *);

(see https://man7.org/linux/man-pages/man2/link.2.html or https://man.netbsd.org/link.2)

And its not some Linux extension, the [syscall
implementation](https://github.com/torvalds/linux/blob/21b136cc63d2a9ddd60d4699552b69c214b32964/fs/namei.c#L4794-L4797)
only expects two arguments too.

It probably *should* have a flags parameter, but its too late now.

I am a bit surprised that linking glibc or musl against code that invokes
a 'link' with three parameters doesn't fail (at least, I couldn't get any
local test cases to trigger a compile or link error).

The test case in std/posix/test.zig is currently disabled, but if I
manually enable it, it works with this change.

```

## Parents

- [979fd12be96d5f8eda3e02ba676aecea78e6c0db](https://git.cafe/gitcafe/zig/commit/979fd12be96d5f8eda3e02ba676aecea78e6c0db?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/4d6429fc4fd299cdfb2256d4aac87bc6551ba09e?format=markdown)
