# Int f() { return ...; }: What do I pass to ccall?

**URL:** https://discourse.julialang.org/t/int-f-return-what-do-i-pass-to-ccall/113957
**Category:** General Usage
**Created:** [May 7, 2024, 5:34pm UTC](https://discourse.julialang.org/t/int-f-return-what-do-i-pass-to-ccall/113957 "2024-05-07T17:34:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [May 7, 2024, 5:34pm UTC](https://discourse.julialang.org/t/int-f-return-what-do-i-pass-to-ccall/113957/1 "2024-05-07T17:34:08Z")

</div>

What do I pass when there are no arguments?

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [May 7, 2024, 5:39pm UTC](https://discourse.julialang.org/t/int-f-return-what-do-i-pass-to-ccall/113957/2 "2024-05-07T17:39:50Z")

</div>

Uf, finally chanced on the right incantation:

```julia
function f()
        return ccall(dlsym(_LIB, :f),
        Cint,
        (),)
    end

```

---

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [May 7, 2024, 5:57pm UTC](https://discourse.julialang.org/t/int-f-return-what-do-i-pass-to-ccall/113957/3 "2024-05-07T17:57:14Z")

</div>

The new `@ccall` macro should make your life a bit easier:

```julia
f() = @ccall _LIB.f()::Cint

```
