Sponsored Content
The Lounge What is on Your Mind? Programming languages polyglots: how many languages you know? Post 302225359 by redoubtable on Friday 15th of August 2008 08:35:50 AM
Old 08-15-2008
I see! So in very simple terms, the letter does not criticize goto by itself. It criticizes programmers that used to over use goto on their programs because that could lead to a less structured and harder to maintain program. Although I can agree with that, I often see people criticizing goto even if it's only used in a structured basis like packing all errors and returns in the end portion of a function:
Code:
int
whatever()
{
        int error;

        do_stuff();
        keep_doing_stuff();
        if (!this_is_right())
        {
                error = EINVAL;
                goto err;
        }
        bla();
        if (this_is_wrong())
        {
                error = EPERM;
                goto err;
        }
        while (...)
        {
                stuff();
                if (stuff2())
                {
                        error = EFAULT;
                        goto err;
                }
        }
        ...
err:
        do_this();
        do_that();
        do_whatever();
        return -error;
}

 

8 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Shell scripting & programming languages

If I want to do high-end 3d animation, what skell scripting languages, and programming languages shoul I learn? If you know any good resources for learning these languages they would be appreciated. (1 Reply)
Discussion started by: aloysius1001
1 Replies

2. UNIX for Advanced & Expert Users

Operating System and Programming languages

I'm trying to create an operating system. Just as a small hobby, it will not be anything big I am trying to get some practice. Does anyone reccomend a certain programming language because I dont know which one to use. Any help please? (2 Replies)
Discussion started by: jacx2
2 Replies

3. UNIX for Dummies Questions & Answers

Programming/Scripting Languages To Learn

Which languages would, in the long run, be best to learn on a UNIX environment for kernel work, every day programs, and overall UNIX programming? I've been learning C for over a year now (which I'm pretty confident with) and decided I want to look into some other languages. I'll mainly be... (1 Reply)
Discussion started by: tjinr
1 Replies

4. Shell Programming and Scripting

output in different languages

hello, i have to change a lot of shell scripts for one reason : the output in a script should be done in different languages. for example: echo "this is a test" and "this is a test" should be printed out in language for an example: german,italian and so. i saw a tool "gettext" ,... (2 Replies)
Discussion started by: bora99
2 Replies

5. Shell Programming and Scripting

bash and languages

Hi everyone, First of all, i dont know what id do without this forum its been such a great help:) so a big thankyou to all, anyway i have a simple question, if i wrote a scrpt in english would it work on another machine with a different language, or do i have to put something in the script to say... (9 Replies)
Discussion started by: dave123
9 Replies

6. UNIX for Advanced & Expert Users

How to export/link Control_m with another programming languages

Hello All. Everyday at work I have to fill a big .xls spreadsheet with process chains start and end time information. The thing is that it takes too long and a lot of boring work. :( I was wondering if I could link this with a tool in java that would export this information into a .xls... (1 Reply)
Discussion started by: pingosa
1 Replies

7. Web Development

What Web Development languages should i learn?

I am learning Web Development, so far i am learning html,xhtml, css, java script.... What I want to know is what other Web Development languages should i learn? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

8. What is on Your Mind?

How can I learn computer programming languages on my own?

I would love the idea to develop games. How can I teach myself computer programming? What programs or software must I use? I have the new iMac? (5 Replies)
Discussion started by: Anna Hussie
5 Replies
seccomp_merge(3)					     libseccomp Documentation						  seccomp_merge(3)

NAME
seccomp_merge - Merge two seccomp filters SYNOPSIS
#include <seccomp.h> typedef void * scmp_filter_ctx; int seccomp_merge(scmp_filter_ctx dst, scmp_filter_ctx src); Link with -lseccomp. DESCRIPTION
The seccomp_merge() function merges the seccomp filter in src with the filter in dst and stores the resulting in the dst filter. If suc- cessfull, the src seccomp filter is released and all internal memory assocated with the filter is freed; there is no need to call sec- comp_release(3) on src and the caller should discard any references to the filter. In order to merge two seccomp filters, both filters must have the same attribute values and no overlapping architectures. RETURN VALUE
Returns zero on success and negative values on failure. EXAMPLES
#include <seccomp.h> int main(int argc, char *argv[]) { int rc = -1; scmp_filter_ctx ctx_32, ctx_64; ctx_32 = seccomp_init(SCMP_ACT_KILL); if (ctx_32 == NULL) goto out_all; ctx_64 = seccomp_init(SCMP_ACT_KILL); if (ctx_64 == NULL) goto out_all; if (seccomp_arch_exist(ctx_32, SCMP_ARCH_X86) == -EEXIST) { rc = seccomp_arch_add(ctx_32, SCMP_ARCH_X86); if (rc != 0) goto out_all; rc = seccomp_arch_remove(ctx_32, SCMP_ARCH_NATIVE); if (rc != 0) goto out_all; } if (seccomp_arch_exist(ctx_64, SCMP_ARCH_X86_64) == -EEXIST) { rc = seccomp_arch_add(ctx_64, SCMP_ARCH_X86_64); if (rc != 0) goto out_all; rc = seccomp_arch_remove(ctx_64, SCMP_ARCH_NATIVE); if (rc != 0) goto out_all; } /* ... */ rc = seccomp_merge(ctx_64, ctx_32); if (rc != 0) goto out_all; /* NOTE: the 'ctx_32' filter is no longer valid at this point */ /* ... */ out: seccomp_release(ctx_64); return -rc; out_all: seccomp_release(ctx_32); goto out; } NOTES
While the seccomp filter can be generated independent of the kernel, kernel support is required to load and enforce the seccomp filter gen- erated by libseccomp. The libseccomp project site, with more information and the source code repository, can be found at http://libseccomp.sf.net. This library is currently under development, please report any bugs at the project site or directly to the author. AUTHOR
Paul Moore <paul@paul-moore.com> SEE ALSO
seccomp_init(3), seccomp_reset(3), seccomp_arch_add(3), seccomp_arch_remove(3), seccomp_attr_get(3), seccomp_attr_set(3) paul@paul-moore.com 28 September 2012 seccomp_merge(3)
All times are GMT -4. The time now is 09:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy