Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9135441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:49:28+00:00 2026-06-17T08:49:28+00:00

I am building a libfcgi-based fastcgi application to provide smart HTTP transfers in git.

  • 0

I am building a libfcgi-based fastcgi application to provide “smart HTTP” transfers in git. To do so, I currently need to fork and exec the git-upload-pack program. The only issue is that libfcgi replaces STDOUT and STDERR with special FCGI file descriptors and git is not aware of these. I want to be able to capture the output of the git program (stdout & stderr) in the parent process so I can send it to the server.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:49:29+00:00Added an answer on June 17, 2026 at 8:49 am

    After you called fork() and prior to calling exec() do the following: call close() on fds 1 and 2 (which is stdout and stderr) and then call dup2() to assign fds of STDOUT and STDERR of libfcgi new fds: 1 and 2. Then you can close original fds of STDOUT and STDERR (they will be closed only for exec’ed git program, but will still be open in your main).

    This should reassign output of git to libfcgi streams. If you want to read streams manually and send data by yourself you can either use pipe() call to create a pair of fds so git can write to one, and you read from another. Or just use popen() which can do this for you (but it won’t let you work with stderr)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
Building a new ASP.net application, and planning to separate DB, 'service' tier and Web/UI
Building an iPhone OS application that will allow users to anonymously post information to
I´m building a small application with Jquery and PHP. Jquery (index.html) adds Form Fields
Building an Android application using Google's GCM service. I have implemented the onRegistered method
Building a relatively simple website, and need to store some data in the database
Building a Monodroid application we've been using Protobuf-net for serialization. It works in debug
Building an excel spreadsheet is a classic asp application. The problem now is that
Building a social network, I'm trying to fetch live notifications. Currently, the site sends
Building a stand alone WPF application that uses a MSSQL backend. I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.